File of service:
/etc/systemd/system/mailgraph.service
Activating service:
gate:/etc/systemd/system # systemctl enable mailgraph.service
ln -s ‘/etc/systemd/system/mailgraph.service’ ‘/etc/systemd/system/multi-user.target.wants/mailgraph.service’
gate:/etc/systemd/system #
Content of unit file:
[Unit]
Description=mailgraph mail log file analyzer
After=syslog.target
[Service]
EnvironmentFile=/etc/sysconfig/mailgraph
Nice=19
Type=forking
ExecStart=/usr/local/bin/mailgraph.pl -d -l ${MAIL_LOG} --daemon-rrd=${RRD_DIR} --daemon-pid=${PID_FILE}
[Install]
WantedBy=multi-user.target
Content of Environment File:
/etc/sysconfig/mailgraph
MAIL_LOG=/var/log/mail PID_FILE=/var/run/mailgraph.pid RRD_DIR=/var/cache/mailgraph.rrd