[systemd-devel] /etc/systemd/system/darkice.service

Lennart Poettering lennart at poettering.net
Thu Jul 18 05:27:09 PDT 2013


On Thu, 18.07.13 18:01, Kai Hendry (hendry at iki.fi) wrote:

> Hi guys,
> 
> http://sprunge.us/SLSF is the service file I have currently. I'm
> running http://archlinuxarm.org/ on a Rpi with systemd 204-3.
> 
> I'm having issues creating a service file for "darkice" a audio
> streamer that depends on:
> * a network connection
> * a microphone sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-sound-card1.device
> 
> First scenario, microphone unplugged:
> 
> [root at pihsg ~]# systemctl status darkice.service
> darkice.service - DarkIce audio forwarder
>    Loaded: loaded (/etc/systemd/system/darkice.service; enabled)
>    Active: failed (Result: exit-code) since Thu 2013-07-18 17:49:41
> SGT; 5min ago
>   Process: 279 ExecStart=/usr/bin/darkice (code=exited, status=255)
> 
> Jul 18 17:49:41 pihsg systemd[1]: Started DarkIce audio forwarder.
> Jul 18 17:49:41 pihsg darkice[279]: DarkIce 1.1 live audio streamer,
> http://code.google.com/p/darkice/
> Jul 18 17:49:41 pihsg systemd[1]: darkice.service: main process
> exited, code=exited, status=255/n/a
> Jul 18 17:49:41 pihsg systemd[1]: Unit darkice.service entered failed state.
> 
> 
> I expected systemd to deny the start with
> sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-sound-card1.device
> loaded inactive dead
> sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-sound-card1.device

You need an After= here for the device, too. 

> Second scenario, microphone plugged in:
> 
> [root at pihsg ~]# systemctl status darkice.service
> darkice.service - DarkIce audio forwarder
>    Loaded: loaded (/etc/systemd/system/darkice.service; enabled)
>    Active: failed (Result: exit-code) since Thu 1970-01-01 07:30:08
> SGT; 43 years 6 months ago

The timestamp looks weird. Does the device have no RTC or so?

>   Process: 121 ExecStart=/usr/bin/darkice (code=exited, status=255)
> 
> journalctl -b | grep -i dark reveals
> 
> DarkIce: TcpSocket.cpp:226: gethostbyname error [0]
> 
> So the network wasn't ready even when depending on nss-lookup.target.
> I did try tweaking restart interval settings to 20, but that didn't
> help either. Any tips?
> 
> The network is brought up by netctl-ifplugd at eth0.service

See: http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list