Hello, I'm trying to setup automatic Oscam startup on my armv7 based mini-PC. It uses latest Debian distro and systemd to control services. I've created and registered a new service to start Oscam, named oscam.service:
[Unit]
Description=oscam
After=tmp.mount network.target
Requires=network.target
[Service]
Type=forking
PIDFile=/var/run/oscam.pid
ExecStart=/usr/bin/oscam -c /usr/local/etc/oscam/ -b -r 2
ExecStop=/usr/bin/rm /var/run/oscam.pid
TimeoutStopSec=1
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
Display More
I can start/stop oscam using systemctl start oscam or systemctl stop oscam, but oscam ignores configuration (-c) path /usr/local/etc/oscam/. Also systemctl status oscam shows another bad things:
oscam.service - oscam
Loaded: loaded (/etc/systemd/system/oscam.service; enabled)
Active: active (running) since Sat 2016-12-31 14:37:13 EET; 9s ago
Main PID: 24639 (oscam)
CGroup: /system.slice/oscam.service
├─24638 /usr/bin/oscam -b -B /var/run/oscam.pid
└─24639 /usr/bin/oscam -b -B /var/run/oscam.pid
Dec 31 14:37:13 lime2 systemd[1]: PID file /var/run/oscam.pid not readable (yet?) after start.
Dec 31 14:37:13 lime2 systemd[1]: oscam.service: Supervising process 24639 which is not our child. We'll mos...exits.
Dec 31 14:37:13 lime2 systemd[1]: Started oscam.
Dec 31 14:37:20 lime2 systemd[1]: oscam.service: Supervising process 24639 which is not our child. We'll mos...exits.
Display More
You can see here bad config path; oscam.pid somewhy is not readable (it exists, I can read it manually); process is not our child (???).
What's wrong with the service configuration? If I start Oscam manually with the same parameters:
/usr/bin/oscam -c /usr/local/etc/oscam/ -b -r 2,
the configuration path is OK:
system# ps aux | grep oscam
root 4002 0.0 0.0 4408 252 ? Ss 15:43 0:00 /usr/bin/oscam -c /usr/local/etc/oscam/ -b -r 2
root 4003 2.1 0.4 33840 4244 ? S<l 15:43 0:00 /usr/bin/oscam -c /usr/local/etc/oscam/ -b -r 2
Oscam version oscam-1.20-unstable_svn-r11297, compiled on this same machine.