Raspberry Service designen
Am Beispiel von WPA-Ping (wird von mir NICHT genutzt)
Das Script sieht so aus:
cat >> /usr/local/bin/wpaping << "EOFWPA" #!/bin/bash # # Loop forever doing wpa_cli SCAN commands # sleeptime=120 # number of seconds to sleep. 2 minutes (120 seconds) is a good value while [ 1 ]; do wpa_cli -i wlan0 scan sleep $sleeptime done EOFWPA
Der Service selber wird so gestaltet:
cat >> /lib/systemd/system/wpaping.service << "EOFWPA" [Unit] Description=WPA Supplicant pinger Requires=network-online.target [Service] ExecStart=/usr/local/bin/wpaping User=root StandardInput=null StandardOutput=null StandardError=null Restart=on-failure [Install] WantedBy=multi-user.target EOFWPA
Um den Service dauerhaft zu starten, einfach den Standard-Weg beschreiten:
systemctl daemon-reload; systemctl enable wpaping.service; systemctl start wpaping.service
Runlevel herausfinden:
runlevel
Eigener Versuch:
[Unit] Description=Sync Logfiles between SD Card and ramdisk Requires=var-log.mount [Service] ExecStart=/home/hss/scripts/rsync-log-files-boot.sh ExecStop=/home/hss/scripts/rsync-log-files-shutdown.sh [Install] WantedBy=multi-user.target