-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
SELinux certainly was causing fun and games. I copied your suggestion to /etc/systemd/user/timidity.service (mode 750) but it's still not happy:
[root@tamar user]# systemctl status timidity timidity.service Loaded: not-found (Reason: No such file or directory) Active: failed (Result: exit-code) since Th...
... Starting LSB: Add and remove timidity... ... timidity.service: control process exited, code=exited status=203 ... Failed to start LSB: Add and remove timidity. ... Unit timidity.service entered failed state. ... Stopped timidity.service.
I've wasted way too much time on this, I've put it in my .profile. The weirdness of systemctl will have to wait!
Thanks all
On 02/04/15 22:16, Andrew Holway wrote:
It might be SELinux. On a standard system; when we run things as a user from the command line SELinux rules do not apply. It would explain why it works manually but not via systemd.
Rather than using an init.d script you might want to try using a systemd service. I haven't tested but something like this should work.
[Unit] Description=timidity daemon
[Service] PIDFile=/var/run/timidity.pid User=someuser Group=someuser WorkingDirectory=/home/someuser ExecStart=/bin/timidity ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true
On 2 April 2015 at 23:07, J Martin Rushton martinrushton56@btinternet.com wrote:
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.
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos