From 29149eb45265b472155899453f47ace0036258ac Mon Sep 17 00:00:00 2001 From: wzeth Date: Sun, 12 Jun 2016 05:29:43 -0400 Subject: [PATCH 1/4] Systemd service file Here is an example systemd config. It makes some assumptions: 1. The user has a systemd service called redis_6379.service (the redis install utils have this as default). 2. srndv2 is contained in /opt/nntpchan --- contrib/config/nntpchan.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contrib/config/nntpchan.service diff --git a/contrib/config/nntpchan.service b/contrib/config/nntpchan.service new file mode 100644 index 0000000..a6e8c52 --- /dev/null +++ b/contrib/config/nntpchan.service @@ -0,0 +1,13 @@ +[Unit] +Description=NNTPChan Server +Requires=redis_6379.service + +[Service] +Type=simple +WorkingDirectory=/opt/nntpchan +ExecStart=/opt/nntpchan/srndv2 run +ExecStop=/bin/kil -15 $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target From 2d25b349f73389c37fcf38d856f12bd96ca1b8e4 Mon Sep 17 00:00:00 2001 From: wzeth Date: Sun, 12 Jun 2016 05:34:59 -0400 Subject: [PATCH 2/4] Oops wrong dir --- contrib/config/nntpchan.service | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 contrib/config/nntpchan.service diff --git a/contrib/config/nntpchan.service b/contrib/config/nntpchan.service deleted file mode 100644 index a6e8c52..0000000 --- a/contrib/config/nntpchan.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=NNTPChan Server -Requires=redis_6379.service - -[Service] -Type=simple -WorkingDirectory=/opt/nntpchan -ExecStart=/opt/nntpchan/srndv2 run -ExecStop=/bin/kil -15 $MAINPID -Restart=always - -[Install] -WantedBy=multi-user.target From 75a3cf5ede60ead078a0b5eb0f1e45ec101ada7e Mon Sep 17 00:00:00 2001 From: wzeth Date: Sun, 12 Jun 2016 05:36:05 -0400 Subject: [PATCH 3/4] systemd service file for nntpchan Assumptions made: 1. The user has a redis_6379.service 2. The user is using /opt/nntpchan as the working directory for the srndv2 --- contrib/configs/systemd/nntpchan.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contrib/configs/systemd/nntpchan.service diff --git a/contrib/configs/systemd/nntpchan.service b/contrib/configs/systemd/nntpchan.service new file mode 100644 index 0000000..a6e8c52 --- /dev/null +++ b/contrib/configs/systemd/nntpchan.service @@ -0,0 +1,13 @@ +[Unit] +Description=NNTPChan Server +Requires=redis_6379.service + +[Service] +Type=simple +WorkingDirectory=/opt/nntpchan +ExecStart=/opt/nntpchan/srndv2 run +ExecStop=/bin/kil -15 $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target From c171e62d520fb3d6bcdf560757c0cf5dc14a5f15 Mon Sep 17 00:00:00 2001 From: wzeth Date: Sun, 12 Jun 2016 05:37:19 -0400 Subject: [PATCH 4/4] oops made a typo --- contrib/configs/systemd/nntpchan.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/configs/systemd/nntpchan.service b/contrib/configs/systemd/nntpchan.service index a6e8c52..b31dd52 100644 --- a/contrib/configs/systemd/nntpchan.service +++ b/contrib/configs/systemd/nntpchan.service @@ -6,7 +6,7 @@ Requires=redis_6379.service Type=simple WorkingDirectory=/opt/nntpchan ExecStart=/opt/nntpchan/srndv2 run -ExecStop=/bin/kil -15 $MAINPID +ExecStop=/bin/kill -15 $MAINPID Restart=always [Install]