summaryrefslogtreecommitdiffstats
path: root/packaging/systemd
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /packaging/systemd
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'packaging/systemd')
-rw-r--r--packaging/systemd/courier-imap.service.in16
-rw-r--r--packaging/systemd/courier-imap.sysvinit.in125
2 files changed, 141 insertions, 0 deletions
diff --git a/packaging/systemd/courier-imap.service.in b/packaging/systemd/courier-imap.service.in
new file mode 100644
index 0000000..e85f7a4
--- /dev/null
+++ b/packaging/systemd/courier-imap.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=Courier-IMAP service
+Wants=network.target
+Wants=courier-authlib.service
+After=network.target
+After=courier-authlib.service
+
+[Install]
+WantedBy=mail-transfer-agent.target
+WantedBy=multi-user.target
+
+[Service]
+Type=forking
+RemainAfterExit=true
+ExecStart=@datadir@/courier-imap.sysvinit start
+ExecStop=@datadir@/courier-imap.sysvinit stop
diff --git a/packaging/systemd/courier-imap.sysvinit.in b/packaging/systemd/courier-imap.sysvinit.in
new file mode 100644
index 0000000..af40fa7
--- /dev/null
+++ b/packaging/systemd/courier-imap.sysvinit.in
@@ -0,0 +1,125 @@
+#!@SHELL@
+#
+# This is a sample /etc/init.d file for Courier-IMAP
+#
+# chkconfig: 2345 80 30
+# description: Courier-IMAP - IMAP server
+#
+#
+#
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+datarootdir=@datarootdir@
+
+case "$1" in
+start)
+ cd /
+ . @sysconfdir@/imapd
+ touch /var/lock/subsys/courier-imap
+
+ echo -n "Starting Courier-IMAP server:"
+
+ case x$IMAPDSTART in
+ x[yY]*)
+ # Start daemons.
+ @libexecdir@/imapd.rc start
+ echo -n " imap"
+ ;;
+ esac
+
+ . @sysconfdir@/imapd-ssl
+ case x$IMAPDSSLSTART in
+ x[yY]*)
+ if test -x $COURIERTLS
+ then
+
+ # First time we start this, generate a dummy SSL certificate.
+
+ if test ! -f $TLS_CERTFILE
+ then
+ echo -n " generating-SSL-certificate..."
+ @datadir@/mkimapdcert >/dev/null 2>&1
+ fi
+ @libexecdir@/imapd-ssl.rc start
+ echo -n " imap-ssl"
+ fi
+ ;;
+ esac
+
+ POP3DSTART=""
+ POP3DSSLSTART=""
+
+ if test -f @sysconfdir@/pop3d
+ then
+ . @sysconfdir@/pop3d
+ fi
+
+ case x$POP3DSTART in
+ x[yY]*)
+ # Start daemons.
+ @libexecdir@/pop3d.rc start
+ echo -n " pop3"
+ ;;
+ esac
+
+ if test -f @sysconfdir@/pop3d-ssl
+ then
+ . @sysconfdir@/pop3d-ssl
+ fi
+
+ case x$POP3DSSLSTART in
+ x[yY]*)
+ if test -x $COURIERTLS
+ then
+
+ # First time we start this, generate a dummy SSL certificate.
+
+ if test ! -f $TLS_CERTFILE
+ then
+ echo -n " generating-SSL-certificate..."
+ @datadir@/mkpop3dcert >/dev/null 2>&1
+ fi
+ @libexecdir@/pop3d-ssl.rc start
+ echo -n " pop3-ssl"
+ fi
+ ;;
+ esac
+
+ echo ""
+ ;;
+stop)
+ echo -n "Stopping Courier-IMAP server:"
+ . @sysconfdir@/imapd
+ . @sysconfdir@/imapd-ssl
+ @libexecdir@/imapd.rc stop
+ echo -n " imap"
+ if test -x $COURIERTLS
+ then
+ @libexecdir@/imapd-ssl.rc stop
+ echo -n " imap-ssl"
+ fi
+
+ if test -f @sysconfdir@/pop3d
+ then
+ @libexecdir@/pop3d.rc stop
+ echo -n " pop3"
+
+ if test -x $COURIERTLS
+ then
+ @libexecdir@/pop3d-ssl.rc stop
+ echo -n " pop3-ssl"
+ fi
+ fi
+
+ echo ""
+ rm -f /var/lock/subsys/courier-imap
+ ;;
+restart)
+ $0 stop
+ $0 start
+ ;;
+esac
+exit 0