You are not logged in.
Well, the topic title says it all! I want to start the hellanzb daemon as my main user 'hb' on boot. If I just add it to the daemons array in rc.conf, it will be run as root, and all my downloaded files will be owned by root:root. How can I make it so it is run by me, not root?
Last edited by HyperBaton (2008-01-25 18:44:11)
Offline
I added hellanzb and several other applications to my autostart menu using this excellent guide:
http://gentoo-wiki.com/HOWTO_Autostart_Programs
Maybe this will help.
Offline
add something similar as the following line to for example /etc/rc.local
su -c '/etc/rc.d/$yourdaemon start' - $you
Offline
Thanks for the link, but I'm afraid I don't run a window manager or login manager on that computer. It's a pure file / download / sync server.
How are the daemons in rc.conf started? Are they started using their rc.d scripts and the "start" parameter? If so, maybe I can make a script that uses hb as the user to start the application?
Offline
add something similar as the following line to for example /etc/rc.local
su -c '/etc/rc.d/$yourdaemon start' - $you
Thanks, I'll give that a try. It doesn't have a daemon script though. I can just start it without one I suppose.
Offline
pressh wrote:add something similar as the following line to for example /etc/rc.local
su -c '/etc/rc.d/$yourdaemon start' - $you
Thanks, I'll give that a try. It doesn't have a daemon script though. I can just start it without one I suppose.
yes, just substitute the command you normally execute as root for the '/etc/rc.d/$yourdaemon start' part.
$you should obviously be your user name.
Offline
Okay, so I have this line added to the rc.local file:
su -c 'hellanzb -D' hb
If i do source /etc/rc.local, the daemon starts. But if I do a reboot it doesnt, like the script ist being run...?
Offline
Okay, so I have this line added to the rc.local file:
su -c 'hellanzb -D' hb
If i do source /etc/rc.local, the daemon starts. But if I do a reboot it doesnt, like the script ist being run...?
which was not what I told you to do
Try this
su -c 'hellanzb -D' - hb
[edit]
if it still doesn't work, you could consider adding an echo statement to rc.local to verify it is indeed sourced (it is by default but you never know)
Last edited by pressh (2008-01-25 13:56:13)
Offline
Okay I'll try it with the dash added, didn't notice that in your syntax, sorry. How would I add the echo statement exactly? And can I view it in a log or something after booting the computer?
Offline
Okay I'll try it with the dash added, didn't notice that in your syntax, sorry. How would I add the echo statement exactly? And can I view it in a log or something after booting the computer?
the echo statement can be as simple as
echo "this is a test"
if you want to log something, you can for example add something like
| tee -a /var/log/mycustom.log
this appends the output of the command before | to /var/log/mycustom.log.
So if you want to log for example the echo statement above, put
echo "this is a test" | tee -a /var/log/mycustom.log
but of course you can catch the output of every command in this way
Offline
Super that did the trick Thanks for all your help!
Offline