Timidity daemon does not start at boot

Kernels & Hardware, configuring network, installing services

Timidity daemon does not start at boot

Postby MartinK » 2018-01-23 14:45

Debian 9, stretch. To troubleshoot a sound problem I stopped the timidity service that was loading at system boot then ran timidity interactively from the console. After getting midi files playing as I wanted I have tried to restart timidity from boot, no go.

In the journal I see;
Code: Select all
sudo journalctl -u timidity

-- Logs begin at Tue 2018-01-23 14:49:46 GMT, end at Tue 2018-01-23 14:54:59 GMT. --
Jan 23 14:49:47 nuc7i5 systemd[1]: Starting LSB: start and stop timidity...
Jan 23 14:49:47 nuc7i5 timidity[463]: Starting TiMidity++ ALSA midi emulation....
Jan 23 14:49:47 nuc7i5 systemd[1]: Started LSB: start and stop timidity.
Jan 23 14:49:47 nuc7i5 pulseaudio[495]: [autospawn] core-util.c: Home directory not accessible: Permission denied
Jan 23 14:49:47 nuc7i5 pulseaudio[495]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.

I also get the first autospawn message on a parallel system that works as expected, so that is not the cause of the problem.

Does the second autospawn message suggest a lock file has been created while running timidity from the command prompt that now stops autoloading of the service at boot?

Using systemctl from the command prompt I can stop timidity, start it, and see the daemon then running.

systemctl enable and disable generate the following "not a native service" response however.
Code: Select all
sudo systemctl enable timidity

timidity.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable timidity

A service managed with systemctl is not a systemd service?

The problem is that after boot systemctl reports the service as active but the daemon is not running.
Code: Select all
systemctl status timidity

● timidity.service - LSB: start and stop timidity
   Loaded: loaded (/etc/init.d/timidity; generated; vendor preset: enabled)
   Active: active (exited) since Tue 2018-01-23 14:49:47 GMT; 16min ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/timidity.service


After stopping the service, then starting it, this is what I see, all good.
Code: Select all
 systemctl status timidity

● timidity.service - LSB: start and stop timidity
   Loaded: loaded (/etc/init.d/timidity; generated; vendor preset: enabled)
   Active: active (running) since Tue 2018-01-23 15:14:33 GMT; 6s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1311 ExecStop=/etc/init.d/timidity stop (code=exited, status=0/SUCCES
  Process: 1325 ExecStart=/etc/init.d/timidity start (code=exited, status=0/SUCC
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/timidity.service
           └─1335 /usr/bin/timidity -Os -iAD


And the journal shows the changes. Note that no running timidity was found but if I don't run 'stop' first, 'start' doesn't work.
Code: Select all
sudo journalctl -u timidity

-- Logs begin at Tue 2018-01-23 14:49:46 GMT, end at Tue 2018-01-23 15:24:38 GMT. --
Jan 23 14:49:47 nuc7i5 systemd[1]: Starting LSB: start and stop timidity...
Jan 23 14:49:47 nuc7i5 timidity[463]: Starting TiMidity++ ALSA midi emulation....
Jan 23 14:49:47 nuc7i5 systemd[1]: Started LSB: start and stop timidity.
Jan 23 14:49:47 nuc7i5 pulseaudio[495]: [autospawn] core-util.c: Home directory not accessible: Permission denied
Jan 23 14:49:47 nuc7i5 pulseaudio[495]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
Jan 23 15:14:25 nuc7i5 systemd[1]: Stopping LSB: start and stop timidity...
Jan 23 15:14:25 nuc7i5 timidity[1311]: Stopping TiMidity++ ALSA midi emulation...No timidity found running; none killed.
Jan 23 15:14:25 nuc7i5 timidity[1311]: .
Jan 23 15:14:25 nuc7i5 systemd[1]: Stopped LSB: start and stop timidity.
Jan 23 15:14:33 nuc7i5 systemd[1]: Starting LSB: start and stop timidity...
Jan 23 15:14:33 nuc7i5 timidity[1325]: Starting TiMidity++ ALSA midi emulation....
Jan 23 15:14:33 nuc7i5 systemd[1]: Started LSB: start and stop timidity.


If you made it this far, any suggestions on how to restore this as the default after boot? systemctl enable does not work. There are references to pulseaudio being involved.
MartinK
 
Posts: 25
Joined: 2015-05-14 21:55
Location: United Kingdom

Re: Timidity daemon does not start at boot

Postby bw123 » 2018-01-23 20:05

It looks like there are bug reports about this already. There could be workarounds in the reports.
http://bugs.debian.org/timidity and timidity-daemon

It doesn't seem to have a service file in the timidity or the daemon pkgs. You could make one yourself or maybe import one from an upstream pkg if there is one.

I'm not real experienced with systemd, but I'm not totally surprised that you can't enable a auto-generated sysV initscript service. Maybe if you stop, disable, unmask, then enable in that order you can fix it. I think it's sort of a kludge the way systemd generates services like this.

Other than that, I don't know. How about purging and reinstalling the pkg, saving any configuration you have done?
User avatar
bw123
 
Posts: 3516
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Timidity daemon does not start at boot

Postby MartinK » 2018-01-23 21:04

Thanks for pointing me at the (long) list of bugs. There are items in there which overlap with what I am seeing.

I tried a complete removal of the timidity and timidity-daemon packages, followed by re-installation to see if restoring scripts in the packages would fix the problem. It did not. Whatever has happened is external to the packages.

I have a working system for comparison so it will be possible to find the difference - eventually. I would rather not do that by hand!

At least I can start the service manually. Some comfort while I brush up on systemd/non-native services.
MartinK
 
Posts: 25
Joined: 2015-05-14 21:55
Location: United Kingdom


Return to System configuration

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable