You are not logged in.
i want to run amuled after boot, so that it is still running when i log out as user or restart the X server.
so i gave rc.local a try but it didn't work (do you need some kind of seperator when there are multiple commands in rc.local ???)
also for amuled it would be "enough" to be started as normal user (not root) - so is there a way to start it as normal user but not to quit even if the user logs out or restarts X?
(hope this was understandable)
Offline
Try adding it to the end of your DAEMONS array in /etc/rc.conf and see if that works.
Offline
/etc/rc.conf will only work if you write an init script for it - the package does not provide one. In the longer term, you could post a feature request for an init script and attach your own, if you decide to write one.
Re rc.local, just put each command on a separate line. Check the man pages to see if there's an option to start as user.
Offline
tomk: i said i tried rc.local not rc.conf ! i can start amuled from a normal command line and it works... no
init script or something is required.
so you guys think it doesn't hurt to start amuled as root?
Offline
zack suggested rc.conf - I clarified how that could be done.
In general, it's considered a bad idea to run daemons as root. If they get compromised, the attacker could gain root access to your system.
Offline
ok so isn't there a file wich starts the program as a normal user ???
i think it would be enough to start it on another terminal than #7 is this possible somehow?
Offline
Not sure if this a good solution but wouldn't it be possible to run it like this:
sudo -u [user name] [command]
Or in case you don't want sudo.
su [user name] -c [command]
Then it is just to put the line inside rc.local .
Offline
I have written an initscript for amuled, not sure if it really works, since I am not using amule. I have tried it with some other daemon. It is based on the "gpm initscript" and some info from this page:
http://www.amule.org/wiki/index.php/FAQ_amuled
Made it mostly because I was curious on how it could be written.
/etc/rc.d/amuled
#!/bin/bash
# source application-specific settings
USER=
[ -f /etc/conf.d/amuled ] && . /etc/conf.d/amuled
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/bin/amuled`
case "$1" in
start)
stat_busy "Starting aMule Daemon"
[ -z "$PID" ] && /bin/su ${USER} -c "/usr/bin/amuled -f >/dev/null"
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon amuled
stat_done
fi
;;
stop)
stat_busy "Stopping aMule Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon amuled
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
/etc/conf.d/amuled
#
# User which will run amuled
#
USER="user name"
<edit>
Change some stuff and tried it with amuled. Seems to work.
</edit>
Offline
this script make use of "su", too.
so wouldn't this work too:
startamuled.sh:
#!bin/bash
su myusername -c amuled
then make the file exectuable and put in my rc.local
Offline
this script make use of "su", too.
so wouldn't this work too:startamuled.sh:
#!bin/bash
su myusername -c amuled
then make the file exectuable and put in my rc.local
Yes, I believe that will work too. Just a note on something I did find out about amuled, it somehow puts the boot up process in a wait condition because it doesn't fork in the background without '-f' or a '&' at the end of the line. It could be something preferable, if you like to see the status of amuled by pressing alt+ctrl+1 . A program or a script that is supposed to be started after this script will probably not run since it will be waiting on a exit condition for amuled.
Offline
ok it works except that i can't pass the -f paramter to amuled like this:
su username -c amuled -f
so how can i fix this?
Offline
su username -c "amuled -f"
1000
Offline
nice - works now!
Offline
screen is another solution...
but ofcause a rc script is more elegant
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
what do you mean with "screen"?
Offline
pacman -S screen
It's a cool tool that allows you to "disconnect" ("detach") from your terminal but keep it running in the background so you can reconnect later. Obviously, this won't survive a reboot. A lot of people (including me) use irssi in screen to be online 24/7 on IRC and IM.
A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.
Offline
http://www.gnu.org/software/screen/
It's the best thing since zsh
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline