I have a init.d script that start|stops|restarts a daemon using the start-stop-daemon.
This daemon is always started as root. I want to be able to specify the user that the init.d script will use to start the daemon.
Tried using the --user option for start-stop-daemon but that is not working.
Can someone please suggest how to do this.
I created a (Debian) init Script for an executable Jar file:
[...]
NAME=NameOfMyShellScript
DAEMON="/usr/share/myApp/bin/$NAME"
USER="myUser"
PIDFILE="/usr/share/myApp/run/$NAME.pid"
EXTRA_ARGS=" -c $USER --background --make-pidfile"
[...]
start-stop-daemon --start --quiet $EXTRA_ARGS --pidfile $PIDFILE --startas $DAEMON --
[...]
My init script basically just invokes start-stop-daemon which ex
I use Fedora 13 and am trying to create a service for darkice.
Hi,
I always get messages like those below in my terminals, that obfuscate my typing.
How can I get rid of them (updated opensuse 11.2)?
I already reconfigured syslog to move PackageKit messags to a separate file (because the messages appeared in /var/log/messages too, and I hoped that was the source). But this did not help.
I wrote a php daemon using system daemon pear class.
How do I use monit to restart it when it fails?
I have the following code in my monit config file:
check process merge with pidfile /var/www/merge/merge.pid
group 1000
start program = "/etc/init.d/merge start"
stop program = "/etc/init.d/merge stop"
if failed host IPADDRESS port 80
then restart
if 5 restarts within 5 cycles then timeout
whe
OK, maybe it's a little stupid to post this here, but I'm unsure of where to file a bug report so...
In /etc/rc.d/init.d/functions, the 'daemon' function calls the 'runuser' program, which doesn't exist in Slackware. Suggest substituting 'su -m'?
I found this when trying to get an initscript for the 'deluge' torrent daemon working, based on the script provided for Fedora.
I normally use service start/stop or initctl start/stop to start or stop a daemon process but now what I am looking for is to disable a daemon process from starting at startup example mysqld.
Currently what am doing is renaming /etc/init/mysql.conf to /etc/init/mysql.conf.bak but after reading a little about systemd I came to know that it provides enable & disable option for the above task.
What are good equivalent centos commands using functions in /etc/init.d/functions such as daemon to perform the following tasks?
On Debian, rsyslog runs by default as root (due to POSIX compatibility). It can drop privileges after start, but a cleaner way would be to start as a non-privileged user. Could somebody please advise, what would be a clean way to set up rsyslog to run as non-privileged user? (which user?). While googling, I found start-stop-daemon, which apparently can make daemon start as non-root.