kopia lustrzana https://github.com/cyoung/stratux
convert from sysv init to systemd for the crash recovery benefits
rodzic
6dd64321dd
commit
29c6787f17
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=Stratux
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/root/stratux-pre-start.sh
|
||||
ExecStart=/usr/bin/gen_gdl90
|
||||
ExecStop=pkill dump1090
|
||||
KillMode=process
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
LimitCORE=1073741824
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo powersave >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
|
||||
|
||||
# Check if we need to run an update.
|
||||
if [ -e /root/update*stratux*v*.sh ] ; then
|
||||
UPDATE_SCRIPT=`ls -1t /root/update*stratux*v*.sh | head -1`
|
||||
if [ -n "$UPDATE_SCRIPT" ] ; then
|
||||
# Execute the script, remove it, then reboot.
|
||||
echo
|
||||
echo "Running update script ${UPDATE_SCRIPT}..."
|
||||
sh ${UPDATE_SCRIPT}
|
||||
rm -f $UPDATE_SCRIPT
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
|
|
@ -18,7 +18,8 @@ mkdir -p work/bin
|
|||
cp gen_gdl90 work/bin/
|
||||
cp libdump978.so work/bin/
|
||||
cp linux-mpu9150/libimu.so work/bin/
|
||||
cp init.d-stratux work/bin/
|
||||
cp __lib__systemd__system__stratux.service work/bin/
|
||||
cp __root__stratux-pre-start.sh work/bin/
|
||||
cp dump1090/dump1090 work/bin/
|
||||
cp -r web work/bin/
|
||||
cp image/hostapd.conf work/bin/
|
||||
|
|
|
@ -4,10 +4,15 @@ cp -f libimu.so /usr/lib/libimu.so
|
|||
|
||||
|
||||
# Startup script.
|
||||
cp -f init.d-stratux /etc/init.d/stratux
|
||||
chmod 755 /etc/init.d/stratux
|
||||
ln -fs /etc/init.d/stratux /etc/rc2.d/S01stratux
|
||||
ln -fs /etc/init.d/stratux /etc/rc6.d/K01stratux
|
||||
rm -f /etc/init.d/stratux
|
||||
rm -f /etc/rc2.d/S01stratux
|
||||
rm -f /etc/rc6.d/K01stratux
|
||||
|
||||
cp -f __lib__systemd__system__stratux.service /lib/systemd/system/stratux.service
|
||||
cp -f __root__stratux-pre-start.sh /root/stratux-pre-start.sh
|
||||
chmod 644 /lib/systemd/system/stratux.service
|
||||
chmod 744 /root/stratux-pre-start.sh
|
||||
ln -fs /lib/systemd/system/stratux.service /etc/systemd/system/multi-user.target.wants/stratux.service
|
||||
|
||||
#wifi config
|
||||
cp -f hostapd.conf /etc/hostapd/hostapd.conf
|
||||
|
|
Ładowanie…
Reference in New Issue