FrontPage
systemd†
/etc/systemd/system
sudo emacs reboot.service
1
2
3
4
5
6
7
| [Unit]
Description = Reboot
RefuseManualStart = true
RefuseManualStop = true
[Service]
ExecStart = /sbin/reboot
|
sudo emacs reboot.timer
1
2
3
4
5
6
7
8
| [Unit]
Description = Weekly Reboot Timer
[Timer]
OnCalendar=*-*-* 10:05:00
[Install]
WantedBy = timers.target
|
sudo systemctl enable reboot.timer
sudo systemctl start reboot.timer
sudo emacs wiki_bot.service
1
2
3
4
5
6
7
8
9
10
11
12
| [Unit]
Description=wiki_bot
After=network.target
[Service]
User=pi
Type=simple
WorkingDirectory=/home/pi/python
ExecStart=/home/pi/python/start_wiki_bot.sh
[Install]
WantedBy=multi-user.target
|
sudo systemctl enable wiki_bot.service
emacs /home/pi/python/start_wiki_bot.sh
chmod 755 /home/pi/python/start_wiki_bot.sh
1
2
3
4
5
| #!/bin/sh
sleep 120
xhost +
export DISPLAY=:0.0
python3 wiki_bot_02.py -s
|