From 19326e31ddad29274d253eba6b7002eb7a84c9fc Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Wed, 22 Aug 2018 01:51:32 +0900 Subject: [PATCH] added service files --- bill_man | 2 ++ bill_man.service | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 bill_man create mode 100644 bill_man.service diff --git a/bill_man b/bill_man new file mode 100644 index 0000000..f476a7b --- /dev/null +++ b/bill_man @@ -0,0 +1,2 @@ +#!/bin/bash +PATH=$VIRTUAL_ENV/bin:$PATH exec python bill_man.py $1 diff --git a/bill_man.service b/bill_man.service new file mode 100644 index 0000000..c7a4135 --- /dev/null +++ b/bill_man.service @@ -0,0 +1,25 @@ +[Unit] +Description=Daily AWS Billing Report Service +After=syslog.target network-online.target +Wants=network-online.target + +[Service] +WorkingDirectory=/home/admin/service/bill_man +Environment=VIRTUAL_ENV=/home/admin/service/bill_man/venv +ExecStart=/home/admin/service/bill_man/bill_man start +ExecStop=/home/admin/service/bill_man/bill_man start +PIDFile=/home/admin/service/bill_man/bill_man.pid +KillMode=process +Restart=on-failure +TimeoutStartSec=5 +Type=forking +PrivateDevices=yes +PrivateTmp=yes +ProtectSystem=full +ReadWriteDirectories=/home/admin/service/bill_man/log +ProtectHome=yes +NoNewPrivileges=yes + +[Install] +#WantedBy=multi-user.target +WantedBy=default.target \ No newline at end of file