From 915b331664059ac12df7fa30e7a94f4744ecb26f Mon Sep 17 00:00:00 2001 From: Adam Stauffer Date: Thu, 3 Aug 2017 11:51:23 -0500 Subject: [PATCH 1/2] add example init script for upstart --- README.md | 3 +++ init-scripts/nessusbeat.conf.upstart | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 init-scripts/nessusbeat.conf.upstart 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 From 61c4e3c6efb156db0a4b546ed865f83d8f11c650 Mon Sep 17 00:00:00 2001 From: Adam Stauffer Date: Mon, 14 Aug 2017 16:48:44 -0500 Subject: [PATCH 2/2] systemd init script --- init-scripts/nessusbeat.service.systemd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 init-scripts/nessusbeat.service.systemd 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