mirror of
https://github.com/svpcom/wfb-ng.git
synced 2025-02-10 11:13:49 -04:00
Add systemd scripts for cluster mode
This commit is contained in:
parent
cd9153c91a
commit
0d683a160f
2
debian/postinst
vendored
Executable file
2
debian/postinst
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
systemctl daemon-reload
|
5
debian/postrm
vendored
Executable file
5
debian/postrm
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
if [ "$1" == "remove" ]
|
||||
then
|
||||
systemctl daemon-reload
|
||||
fi
|
6
debian/prerm
vendored
Executable file
6
debian/prerm
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
if [ "$1" == "remove" ]
|
||||
then
|
||||
systemctl stop wifibroadcast
|
||||
systemctl stop wfb-cluster
|
||||
fi
|
17
scripts/wfb-cluster-manager@.service
Normal file
17
scripts/wfb-cluster-manager@.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=WFB-ng cluster manager, profile %i
|
||||
Requires=wfb-cluster.service
|
||||
ReloadPropagatedFrom=wfb-cluster.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/bin/bash -c "exec /usr/bin/wfb-server --profiles $(echo %i | tr : ' ') --cluster manual"
|
||||
TimeoutStopSec=5s
|
||||
KillMode=mixed
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
# Set logging to file in wifibroadcast.cfg
|
||||
StandardError=inherit
|
||||
|
||||
[Install]
|
||||
WantedBy=wfb-cluster.service
|
16
scripts/wfb-cluster-node.service
Normal file
16
scripts/wfb-cluster-node.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=WFB-ng cluster node
|
||||
Requires=wfb-cluster.service
|
||||
ReloadPropagatedFrom=wfb-cluster.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/sbin/wfb-ng.sh
|
||||
TimeoutStopSec=5s
|
||||
Restart=on-failure
|
||||
KillMode=mixed
|
||||
RestartSec=5s
|
||||
StandardError=inherit
|
||||
|
||||
[Install]
|
||||
WantedBy=wfb-cluster.service
|
17
scripts/wfb-cluster.service
Normal file
17
scripts/wfb-cluster.service
Normal file
@ -0,0 +1,17 @@
|
||||
# This is a mostly empty service, but allows commands like stop, start, reload
|
||||
# to propagate to all wfb-cluster services instances.
|
||||
|
||||
[Unit]
|
||||
Description=WFB-ng cluster
|
||||
After=network.target
|
||||
Conflicts=wifibroadcast.service
|
||||
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/bin/true
|
||||
ExecReload=/bin/true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -2,8 +2,9 @@
|
||||
# to propagate to all wifibroadcast@ service instances.
|
||||
|
||||
[Unit]
|
||||
Description=Wifibroadcast server
|
||||
Description=WFB-ng standalone server
|
||||
After=network.target
|
||||
Conflicts=wfb-cluster.service
|
||||
#After=network.target sys-subsystem-net-devices-wlx00c0caa578a9.device
|
||||
#Requires=sys-subsystem-net-devices-wlx00c0caa578a9.device
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=WFB profile %i
|
||||
PartOf=wifibroadcast.service
|
||||
Description=WFB-ng standalone server, profile %i
|
||||
Requires=wifibroadcast.service
|
||||
ReloadPropagatedFrom=wifibroadcast.service
|
||||
|
||||
[Service]
|
||||
@ -10,10 +10,11 @@ EnvironmentFile=/etc/default/wifibroadcast
|
||||
# per-profile environment
|
||||
EnvironmentFile=-/etc/default/wifibroadcast.%i
|
||||
ExecStart=/bin/bash -c "exec /usr/bin/wfb-server --profiles $(echo %i | tr : ' ') --wlans ${WFB_NICS}"
|
||||
KillMode=mixed
|
||||
TimeoutStopSec=5s
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
# Set logging to file in wifibroadcast.cfg
|
||||
# Set logging to file in /etc/wifibroadcast.cfg
|
||||
StandardError=inherit
|
||||
|
||||
[Install]
|
||||
|
5
setup.py
5
setup.py
@ -50,7 +50,10 @@ setup(
|
||||
package_data={'wfb_ng.conf': ['master.cfg', 'site.cfg']},
|
||||
data_files = [('/usr/bin', ['wfb_tx', 'wfb_rx', 'wfb_keygen', 'wfb_tx_cmd', 'scripts/wfb-cli-x11']),
|
||||
('/lib/systemd/system', ['scripts/wifibroadcast.service',
|
||||
'scripts/wifibroadcast@.service']),
|
||||
'scripts/wifibroadcast@.service',
|
||||
'scripts/wfb-cluster.service',
|
||||
'scripts/wfb-cluster-node.service',
|
||||
'scripts/wfb-cluster-manager@.service']),
|
||||
('/etc/default', ['scripts/default/wifibroadcast']),
|
||||
('/etc/sysctl.d', ['scripts/98-wifibroadcast.conf']),
|
||||
('/etc/logrotate.d', ['scripts/wifibroadcast'])] if install_data_files else [],
|
||||
|
Loading…
Reference in New Issue
Block a user