forked from pi-desktop/deb-make
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* better comments in services * Update pidesktop-powerkey.service * Update pidesktop-shutdown.service * Create pidesktop-reboot.service * Update pidesktop-reboot.service * Update pidesktop-shutdown.service * Update postinst add reboot service * Update postrm add reboot service * Create pd-reboot.py new reboot service file * split out reboot service
- Loading branch information
1 parent
9665baa
commit 2f1bd05
Showing
12 changed files
with
89 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Package: pidesktop-base | ||
Version: 0.1.4 | ||
Version: 0.1.5 | ||
Section: free | ||
Priority: optional | ||
Architecture: all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[Unit] | ||
Description=PiDesktop Power Button Service | ||
Description=pidesktop power button service | ||
After=local-fs.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/python /usr/share/pidesktop/python/pd-powerkey.py | ||
ExecStart=/usr/bin/python -u /usr/share/pidesktop/python/pd-powerkey.py | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
11 changes: 11 additions & 0 deletions
11
pidesktop-base/lib/systemd/system/pidesktop-reboot.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=pidesktop reboot service | ||
DefaultDependencies=no | ||
Before=reboot.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/python -u /usr/share/pidesktop/python/pd-reboot.py | ||
|
||
[Install] | ||
WantedBy=reboot.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[Unit] | ||
Description=PiDesktop Shutdown Reboot Service | ||
Description=pidesktop shutdown service | ||
DefaultDependencies=no | ||
Before=shutdown.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/python /usr/share/pidesktop/python/pd-shutdown.py | ||
ExecStart=/usr/bin/python -u /usr/share/pidesktop/python/pd-shutdown.py | ||
|
||
[Install] | ||
WantedBy=reboot.target shutdown.target | ||
WantedBy=shutdown.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/user/bin/env python | ||
|
||
# pd-reboot.py - oneshot service so do your thing and exit | ||
# | ||
# We are in reboot processing either because reboot is running. | ||
# | ||
import RPi.GPIO as GPIO | ||
import os | ||
|
||
GPIO.setwarnings(False) | ||
GPIO.setmode(GPIO.BOARD) # Use physical board pin numbering | ||
GPIO.setup(31,GPIO.OUT) # Pi to Power MCU communication | ||
GPIO.setup(33,GPIO.IN) # Power MCU to Pi on power button | ||
|
||
# In practice detecting power button press is unfortunately not reliable, message if detected | ||
if GPIO.input(33): | ||
# Power Key was already pressed - shut the system down immediately | ||
print("pidesktop: reboot service unexpected power button detected") | ||
else: | ||
# reboot initiated do whatever is needed on reboot | ||
# GPIO.output(31,GPIO.HIGH) # tell power MCU and exit immediately | ||
print("pidesktop: reboot service active") | ||
|
||
# we're done | ||
print("pidesktop: reboot service completed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# show script and python files | ||
echo -e "pidesktop\n\n Scripts and python files:\n" | ||
ls -laR /usr/share/pidesktop | ||
# show scripts and python files | ||
echo -e "pidesktop\n\n Script files:\n" | ||
ls -laR /usr/share/pidesktop/* | ||
|
||
# show links to pd- commands | ||
echo -e "\n Links to commands:\n" | ||
ls -la /usr/bin/pd-* | ||
|
||
# show sevices | ||
echo -e "\n Systemd services:\n" | ||
sudo systemctl list-unit-files | grep pidesktop | ||
systemctl --plain --no-legend list-unit-files 'pidesktop-*' | ||
|
||
# show RTC hwclock | ||
echo -e "\n Hardware clock:\n" | ||
sudo hwclock -r | ||
echo -e "\n System and hardware clocks:\n" | ||
timedatectl status | ||
|
||
# show System clock | ||
echo -e "\n System clock:\n" | ||
date | ||
# show installed version | ||
echo -e "\n Package status:\n" | ||
dpkg -s pidesktop-base |