I have created this systemctl job,
[Unit]
Description=Evercam Media
After=network.target
[Service]
Type=forking
User=root
Group=root
WorkingDirectory=/opt/evercam_media
ExecStart=/opt/evercam_media/bin/evercam_media start
ExecStop=/opt/evercam_media/bin/evercam_media stop
Restart=always
RestartSec=5
Environment=LANG=en_US.UTF-8
SyslogIdentifier=evercam_media
[Install]
WantedBy=multi-user.target
It's working perfectly, as I want it to work, But I want to show some log on start and stop, as when we start or stop the upstart job, it shows us, the job is stopped or waiting, But it's not showing anything, Can we add few logs like "Its started" or Its stopped, something like this?
Also when I see the status of this job while doing systemctl status evercam_media.service
, it shows me
● evercam_media.service - Evercam Media
Loaded: loaded (/etc/systemd/system/evercam_media.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-11-07 10:53:40 CET; 1h 3min ago
Process: 25830 ExecStop=/opt/evercam_media/bin/evercam_media stop (code=exited, status=0/SUCCESS)
Process: 25692 ExecStart=/opt/evercam_media/bin/evercam_media start (code=exited, status=0/SUCCESS)
Main PID: 25728 (code=exited, status=1/FAILURE)
Active: Failed??
Why it's not saying its stopped instead of failed? any help would be appreciated thanks.