diff --git a/README.md b/README.md index dfef6fc..1ebe944 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,9 @@ To run Nessusbeat with debugging output enabled, run: ./nessusbeat -c nessusbeat.yml -e -d "*" ``` +To run on startup, see the [init-scripts](https://github.com/darvid/nessusbeat/tree/master/init-scripts) +folder for example configuration files for each init system. + ### Roadmap - [ ] Add option to poll remote Nessus and SecurityCenter diff --git a/init-scripts/nessusbeat.conf.upstart b/init-scripts/nessusbeat.conf.upstart new file mode 100644 index 0000000..7440cf8 --- /dev/null +++ b/init-scripts/nessusbeat.conf.upstart @@ -0,0 +1,11 @@ +description "nessusbeat" +start on runlevel [2345] +stop on runlevel [!2345] +respawn +env DAEMONUSER=root +env DAEMON=/opt/nessusbeat/nessusbeat +env DAEMON_ARGS="-c /opt/nessusbeat/nessusbeat.yml" +script + /bin/su - -c "$DAEMON $DAEMON_ARGS" $DAEMONUSER +end script +post-stop exec sleep 5 diff --git a/init-scripts/nessusbeat.service.systemd b/init-scripts/nessusbeat.service.systemd new file mode 100644 index 0000000..154d18b --- /dev/null +++ b/init-scripts/nessusbeat.service.systemd @@ -0,0 +1,15 @@ +[Unit] +Description=nessusbeat +After=network.target + +[Service] +User=root +WorkingDirectory=/opt/nessusbeat +ExecStart=/opt/nessusbeat/nessusbeat -c nessusbeat.yml +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MAINPID +Restart=always +ExecStopPost=/bin/sleep 5 + +[Install] +WantedBy=multi-user.target