diff --git a/{{cookiecutter.app_name}}/etc/default/{{cookiecutter.app_name}} b/{{cookiecutter.app_name}}/etc/default/{{cookiecutter.app_name}} deleted file mode 100644 index 475c2f0..0000000 --- a/{{cookiecutter.app_name}}/etc/default/{{cookiecutter.app_name}} +++ /dev/null @@ -1,3 +0,0 @@ -# Start the daemon by default, let the user disable it. -START_DAEMON=yes -DAEMON_ARGS="--config_dir=/etc/{{cookiecutter.app_name}} -ac --chdir=/opt/{{cookiecutter.app_name}} {{cookiecutter.app_name}}:Container" diff --git a/{{cookiecutter.app_name}}/etc/init.d/{{cookiecutter.app_name}} b/{{cookiecutter.app_name}}/etc/init.d/{{cookiecutter.app_name}} deleted file mode 100755 index 1390c6d..0000000 --- a/{{cookiecutter.app_name}}/etc/init.d/{{cookiecutter.app_name}} +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: {{cookiecutter.app_name}} -# Required-Start: $local_fs $remote_fs $network $syslog -# Required-Stop: $local_fs $remote_fs $network $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Startup daemon script for {{cookiecutter.app_name}} -### END INIT INFO -# -# Author: Ludovic Gasc -set -e - -EXECUTABLE_PATH=/opt/{{cookiecutter.app_name}}/pyvenv/bin -PATH=$EXECUTABLE_PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin -DAEMONNAME={{cookiecutter.app_name}} -RUNDIR=/run/$DAEMONNAME -DAEMON=$EXECUTABLE_PATH/api_hour -PIDFILE=/run/lock/${DAEMONNAME}.pid -DAEMON_ARGS="" - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Create RUNDIR if it doesn't exist -[ -d "$RUNDIR" ] || mkdir -p "$RUNDIR" - -# Read configuration variable file if it is present -[ -r /etc/default/$DAEMONNAME ] && . /etc/default/$DAEMONNAME - -# Load the VERBOSE setting and other rcS variables -[ -f /etc/default/rcS ] && . /etc/default/rcS - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -case "$1" in - start) - log_daemon_msg "Starting" "$DAEMONNAME" - if start-stop-daemon -b --start --pidfile $PIDFILE --startas $DAEMON -- $DAEMON_ARGS; - then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - stop) - log_daemon_msg "Stopping" "$DAEMONNAME" - if start-stop-daemon --stop --retry 5 --pidfile $PIDFILE; - then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - reload|force-reload) - log_daemon_msg "Reloading" "$DAEMONNAME" - if start-stop-daemon --stop --signal 1 --pidfile $PIDFILE --startas $DAEMON; - then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - restart) - $0 stop - $0 start - ;; - status) - status_of_proc -p $PIDFILE "$DAEMON" $DAEMONNAME && exit 0 || exit $? - ;; - *) - echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" - exit 1 - ;; -esac - -exit 0 diff --git a/{{cookiecutter.app_name}}/etc/logrotate.d/{{cookiecutter.app_name}} b/{{cookiecutter.app_name}}/etc/logrotate.d/{{cookiecutter.app_name}} deleted file mode 100644 index 4ae695b..0000000 --- a/{{cookiecutter.app_name}}/etc/logrotate.d/{{cookiecutter.app_name}} +++ /dev/null @@ -1,7 +0,0 @@ -/var/log/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.log { - daily - rotate 15 - compress - copytruncate - missingok -} \ No newline at end of file diff --git a/{{cookiecutter.app_name}}/etc/monit/conf.d/{{cookiecutter.app_name}} b/{{cookiecutter.app_name}}/etc/monit/conf.d/{{cookiecutter.app_name}} deleted file mode 100644 index 2787ef0..0000000 --- a/{{cookiecutter.app_name}}/etc/monit/conf.d/{{cookiecutter.app_name}} +++ /dev/null @@ -1,5 +0,0 @@ -check process cache_updater with pidfile /run/lock/{{cookiecutter.app_name}}.pid - group {{cookiecutter.app_name}} - start program = "/etc/init.d/{{cookiecutter.app_name}} start" - stop program = "/etc/init.d/{{cookiecutter.app_name}} stop" - if 5 restarts within 5 cycles then timeout \ No newline at end of file diff --git a/{{cookiecutter.app_name}}/etc/rsyslog.conf b/{{cookiecutter.app_name}}/etc/rsyslog.conf deleted file mode 100644 index a483c97..0000000 --- a/{{cookiecutter.app_name}}/etc/rsyslog.conf +++ /dev/null @@ -1,126 +0,0 @@ -# /etc/rsyslog.conf Configuration file for rsyslog. -# -# For more information see -# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html - - -################# -#### MODULES #### -################# - -$ModLoad imuxsock # provides support for local system logging -$ModLoad imklog # provides kernel logging support -#$ModLoad immark # provides --MARK-- message capability -$SystemLogRateLimitInterval 1 -$SystemLogRateLimitBurst 1000 - -# provides UDP syslog reception -#$ModLoad imudp -#$UDPServerRun 514 - -# provides TCP syslog reception -#$ModLoad imtcp -#$InputTCPServerRun 514 - - -########################### -#### GLOBAL DIRECTIVES #### -########################### - -# -# Use traditional timestamp format. -# To enable high precision timestamps, comment out the following line. -# -$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat - -# -# Set the default permissions for all log files. -# -$FileOwner root -$FileGroup adm -$FileCreateMode 0640 -$DirCreateMode 0755 -$Umask 0022 - -# -# Where to place spool and state files -# -$WorkDirectory /var/spool/rsyslog - -# -# Include all config files in /etc/rsyslog.d/ -# -$IncludeConfig /etc/rsyslog.d/*.conf - - -############### -#### RULES #### -############### - -# -# First some standard log files. Log by facility. -# -auth,authpriv.* /var/log/auth.log -*.*;auth,authpriv.none;\ - local6.none -/var/log/syslog -#cron.* /var/log/cron.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -lpr.* -/var/log/lpr.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log - -local6.* /var/log/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.log - -# -# Logging for the mail system. Split it up so that -# it is easy to write scripts to parse these files. -# -mail.info -/var/log/mail.info -mail.warn -/var/log/mail.warn -mail.err /var/log/mail.err - -# -# Logging for INN news system. -# -news.crit /var/log/news/news.crit -news.err /var/log/news/news.err -news.notice -/var/log/news/news.notice - -# -# Some "catch-all" log files. -# -*.=debug;\ - auth,authpriv.none;\ - news.none;mail.none;local6.none;local7.none -/var/log/debug -*.=info;*.=notice;*.=warn;\ - auth,authpriv.none;\ - cron,daemon.none;\ - mail,news.none;local6.none;local7.none -/var/log/messages - -# -# Emergencies are sent to everybody logged in. -# -*.emerg :omusrmsg:* - -# -# I like to have messages displayed on the console, but only on a virtual -# console I usually leave idle. -# -#daemon,mail.*;\ -# news.=crit;news.=err;news.=notice;\ -# *.=debug;*.=info;\ -# *.=notice;*.=warn /dev/tty8 - -# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, -# you must invoke `xconsole' with the `-file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -# NOTE: adjust the list below, or you'll go crazy if you have a reasonably -# busy site.. -# -daemon.*;mail.*;\ - news.err;\ - *.=debug;*.=info;\ - *.=notice;*.=warn |/dev/xconsole diff --git a/{{cookiecutter.app_name}}/etc/systemd/system/{{cookiecutter.app_name}}.service b/{{cookiecutter.app_name}}/etc/systemd/system/{{cookiecutter.app_name}}.service new file mode 100644 index 0000000..1f2702e --- /dev/null +++ b/{{cookiecutter.app_name}}/etc/systemd/system/{{cookiecutter.app_name}}.service @@ -0,0 +1,10 @@ +[Unit] +Description={{cookiecutter.app_name}} +After=network.target + +[Service] +Type=simple +ExecStart=/opt/{{cookiecutter.app_name}}/pyvenv/bin/api_hour --config_dir=/etc/{{cookiecutter.app_name}} -ac --chdir=/opt/{{cookiecutter.app_name}} {{cookiecutter.app_name}}:Container + +[Install] +WantedBy=multi-user.target