Man page says default dir for slrnrc should be $HOME, but it isn't.

Asked by ShadowTek

The man page for slrn says that the default dir for slrnrc should be $HOME:
        -i config-file
              Read file as the initialization (slrnrc) file. The default is to use .slrnrc (or slrn.rc on VMS, OS/2 and Windows) in your home directory.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu slrn Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
ShadowTek (psistormyamato) said :
#1

Whoops, I accidentally hit enter, and there doesn't seem to be an edit feature.

Anyway, this caused some unnecessary confusion until I noticed that the command line was clearly stating:

 Reading startup file /etc/news/slrn.rc.

So, I used to "-i" switch to use the file that was actually in $HOME, and now the result is:

 Reading startup file /etc/news/slrn.rc.
 Reading startup file slrn.rc.

So why is it trying to read from /etc/news/ if $HOME is supposed to be the default?

And why is it now trying to read from 2 files instead of the one that I specified?

Anyway, I'm not having any problems right now, as the desired config file is being read, but I just wanted to point out this confusing little bit in case something can be done to avoid future confusion for others.

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#2

if you have the file in $HOME then you could create a symlink to the file in the place it is reading

if:

file /etc/news/slrn.rc

says no such file or directory then you can run this:

sudo ln -s ~/slrn.rc /etc/news/slrn.rc

This will create a mirrored file (using zero space on the partition) to the file in your $HOME directory in the place it appears to be looking for the file.

I would log a bug too

Revision history for this message
ShadowTek (psistormyamato) said :
#3

A'ight, thanks.

Revision history for this message
ShadowTek (psistormyamato) said :
#4

Thanks actionparsnip, that solved my question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Awesome :)

Glad you got the gold/

Revision history for this message
andrew.46 (andrew.46-deactivatedaccount) said :
#6

Mind you the file /etc/news/slrn.rc is normally reserved for system settings for slrn while the user is expected to create their own $HOME/.slrnrc file with individual settings. This must be done manually as a default Ubuntu installation does not create the file. There are several ways to do this. It can be created from the slrn website itself:

wget http://slrn.sourceforge.net/downloads/slrn.rc -O $HOME/.slrnrc

This file is a slightly improved version from that found in the Ubuntu installation BTW. The file can also be created from the 'examples' directory of slrn as follows:

zcat /usr/share/doc/slrn/examples/slrn.rc.gz > $HOME/.slrnrc

The file must then be customised before it is usable. You may be interested to see these details + a full installation guide on the Ubuntu Community pages:

slrn - Community Ubuntu Documentation
https://help.ubuntu.com/community/slrn

which I have just finished writing :-).

Andrew

Revision history for this message
ShadowTek (psistormyamato) said :
#7

If the user is expected to create their own rc file in $HOME, then are they also expected to have to start slrn with the "-i" switch to specify that file every time?

If so, it seems a little odd.

If you were running slrn as root, *then* it would make more sense to me that it might look to /etc/ by default.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

it would make no sense to look in /etc/ as root, roots $HOME is /root not /etc

This senario is also similar to conky where a sample .cokyrc file is hidden in the files of the package but many examples online.

running something so trivial as a newsreader which doesnt need elevated priveledges is also not advised due to security, nor is it advisable to run with sudo. It is a web based app and keeping the number of web based apps running with elevated priveledges to a minimum is important for security. Something windows users ignore, then wonder why malicious java script / flash apps running in their browsers has so much system access

Revision history for this message
ShadowTek (psistormyamato) said :
#9

I was just saying that it would make more sense for root to be associated with /etc/ due to the fact that it's a root owned dir.

I wasn't suggesting that it should be that way.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

nearly all of the files outside your home directory are owned by root, roots home has always been /root and since .slrnrc file goes in the root of home then the location of the file will be /root/.slnrnrc as root is just another user like your username is.

Revision history for this message
andrew.46 (andrew.46-deactivatedaccount) said :
#11

Hi ShadowTek,

You will not need to use the -i option for your $HOME/.slrnrc file. The sequence that slrn accepts (which is common for a lot of linux software) is:

1. Commandline options
2. $HOME/.slrnrc file
3. /etc/news/slrn.rc

and slrn looks at each in turn on startup. I am not familiar with conky which actionparsnip mentioned but I would imagine it has a similar setup.

Andrew