-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I've been trying to get the timidity system running as a daemon. I wrote the following init script:
#!/bin/sh # # timidity # ### BEGIN INIT INFO # Provides: timidity # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Add and remove timidity # Description: ### END INIT INFO
. /etc/rc.d/init.d/functions
RETVAL=0 PROG=timidity EXEC=/bin/$PROG PIDFILE=/var/run/timidity.pid
function start { [[ -x $EXEC ]] || exit 5 echo -n "Starting $PROG: " $EXEC -iAD RETVAL=$? echo return $RETVAL }
function stop { echo -n "Stopping $PROG: " killproc $EXEC -TERM RETVAL=$? echo return $RETVAL }
case "$1" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; status) status $PROG RETVAL=$? ;; restart) stop start ;; reload) stop start ;; *) echo $"Usage: $prog {start|stop|status|restart|reload}" exit 1 esac exit $RETVAL
When run through systemctl during startup it fails:
[root@tamar init.d]# systemctl status timidity timidity.service - LSB: Add and remove timidity Loaded: loaded (/etc/rc.d/init.d/timidity) Active: active (exited) since Thu ... Process: 784 ExecStart=/etc/rc.d/init.d/timidity start (code=exited, status=0/SUCCESS)
... Starting LSB: Add and remove timidity... ... Starting timidity: ... jack_client_new: deprecated ... Started LSB: Add and remove timidity. ... Cannot connect to server socket err = No such file or directory ... Cannot connect to server request channel ... jack server is not running or cannot be started ... Couldn't open output device
But when run directly is works fine:
[root@tamar init.d]# ./timidity start Starting timidity: TiMidity starting in ALSA server mode Opening sequencer port: 128:0 128:1 128:2 128:3
If I use # service timidity start it also fails.
I _think_ that what is happening is that systemctl is stripping off the switch. I've spent a couple of hours searching for any links or explanation and got nowhere. I even knocked up a script to try and separate the two parts: #!/bin/sh cd /etc/init.d ./timidity start but to no avail.
If there is a simple fix could someone point me there, if it's complex don't bother, I only need the daemon when running MIDI and can start it by hand.