petterreinholdtsen / battery-stats

Log battery charge (battery-stats-collector), show gnuplot graphs (battery-graph)
GNU General Public License v2.0
27 stars 13 forks source link

Init script #35

Open BillyCroan opened 2 years ago

BillyCroan commented 2 years ago

I just installed from git and it appears that no init script gets installed by default. I will share the systemd script I created for my system:

# cat /etc/systemd/system/battery-stats-collector.service 
[Unit]
Description = battery-stats-collector daemon

[Service]
Type = simple
PIDFile = /run/battery-stats-collector.pid
ExecStart = /usr/local/sbin/battery-stats-collector
Restart = on-abort
StartLimitInterval = 60
StartLimitBurst = 10

[Install]
WantedBy = multi-user.target

The config file /etc/battery-stats.conf, refers to a certain /etc/init.d/battery-stats script for INIT based systems:

# Default configuration for battery-stats-collector
#
# This file is sourced from /etc/init.d/battery-stats ; it should follow normal
# /bin/sh syntax.
.....

But no such init script is installed during make install, or indeed appears to be present in the git repo.