You are not logged in.
I have this issue for two precise applications:
1. Mplayer - Wich I use as wallpaper but sometimes gets killed
2. Osdlyrics - It gest killed for no special reason (Seg fault)
I want to make a script so this applications be restarted in case they get killed, how could I track that and restart it?
Thank you ![]()
Offline
Write a service file...
Offline
Great idea! But I've read million of times the https://wiki.archlinux.org/index.php/Sy … vice_files and to be honest I don't understand anything!
I don't get the "Types" or wich dependencies might this applications need.
Any help.. please ![]()
Offline
Read the systemd man pages. I have found that their documentation (although not complete since new features are still being added) is quite good. The stuff for systemd.unit files is generally very complete. The only issue one might have in wading through those man pages is that the unit files are separated into a bunch of different systemd.* man pages. But fortunately, there is the systemd.directives man page which can tell you where to find info on each configuration option... and more.
Offline
I did my best but I really don't get it ![]()
Problem after problem...
This is not explained very well in man nor in the wiki :S
Offline
What did you try? "Problem after problem" is not an error message.
Also, the documentation for systemd is above average, IMO.
/usr/lib/systemd/system/ is stuffed full of service files: copy one that is similar to what you need and start from there; it is not difficult.
Offline
OK I'll show you what I have :
[Service]
Type=simple
ExecStart=/usr/bin/wallpaper
ExecStartPre=/usr/bin/xfdesktop
Restart=alwayssystemd status wallpaper.service throws:
wallpaper.service
Loaded: loaded (/etc/systemd/system/wallpaper.service; static)
Active: failed (Result: start-limit) since sáb 2013-11-02 12:10:38 CST; 11s ago
Process: 13911 ExecStartPre=/usr/bin/xfdesktop (code=exited, status=1/FAILURE)
Main PID: 1743 (code=exited, status=0/SUCCESS)If I remove the line of xfdesktop the output shows as active but nothing is displaying
THis is my /usr/bin/wallpaper :
#!/bin/bash
WIND=$(xwininfo -name Escritorio | egrep -E '0x' | cut -d':' -f3 | cut -d'"' -f1| cut -d' ' -f2)
echo "Desktop is " $WIND
mkfifo /tmp/mplayer-control
touch /tmp/wallpaper-status
DesktopMovie -wid $WIND -x 1366 -y 768 -slave -input file=/tmp/mplayer-control -shuffle -loop 0 -playlist /home/axelectrik/.config/wallpaper/playlist.m3u &> /tmp/wallpaper-status &
echo "Playing" $WINDANd the output of /tmp/wallpaper-status is:
Cannot find HOME directory.
The wid option must be an integer: -x
Error parsing commandline option "-wid": Option parameter could not be parsed
MPlayer2 2.0-726-g6c87a98 (C) 2000-2012 MPlayer TeamSo I don't know why the service cannot start xfdesktop, or if is already started why xwininfo is not giving the xfdesktop window ID so mplayer starts over there.
Last edited by axelectrik (2013-11-02 18:23:21)
Offline