Added boot script examples

This commit is contained in:
Bjango
2016-10-24 18:33:24 +11:00
parent 63e8613616
commit 0818cce407
6 changed files with 51 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
._*
istatserver
config.h
config.log
config.status

View File

@@ -1,6 +1,6 @@
dist_man_MANS = istatserver.1 istatserver.conf.5
EXTRA_DIST = istatserver.conf istatserver_generated.conf
EXTRA_DIST = istatserver.conf istatserver_generated.conf systemd upstart rc.d
#dist_sysconf_DATA = istatserver.conf

16
resource/rc.d/istatserver Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
#
# PROVIDE: istatserver
# REQUIRE: FILESYSTEMS NETWORKING netif
# KEYWORD: shutdown
. /etc/rc.subr
name="istatserver"
command="/usr/local/bin/istatserver"
rcvar="istatserver_enable"
command_args="-d"
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,17 @@
#
# istatserver daemon service unit file
#
[Unit]
Description=System monitoring daemon for remote monitoring with iStat for iOS or iStat for macOS
Documentation=man:istatserver(1)
After=network.target
[Service]
ExecStart=/usr/local/bin/istatserver -d
Restart=on-abort
RestartSec=5
Type=forking
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,16 @@
# istatserver
description "istatserver daemon"
author "Bjango"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on shutdown
expect daemon
expect fork
respawn
respawn limit 99 5
script
exec /usr/local/bin/istatserver -d
end script

View File

@@ -106,7 +106,7 @@ int main(int argc, char ** argv)
cout << endl;
cout << " --pid=FILE custom pid file location" << endl;
cout << " --socket=FILE custom socket file location" << endl;
cout << " --code=CODE custom lock code" << endl;
cout << " --code=CODE custom passcode" << endl;
cout << endl;
return 0;
}