Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Create caldavd #516

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions doc/Admin/caldavd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Calendar and Contacts Server daaemon
# Description: This file is prepared to start Calendar and Contacts Server
# as a daemon.
# single forking daemon capable of writing a pid
# file. To get other behavoirs, implemend
# do_start(), do_stop() or other functions to
# override the defaults in /lib/init/init-d-script.
### END INIT INFO

# Author: Tamás Nacsák <[email protected]>
# Thanks to cpc11-cdif12-2-0-cust1 at UbuntuWiki https://wiki.ubuntu.com/CalendarServer/GutsyRecipe
# who prepared the basis, what had to be actualised only

DESC="Calendar and Contacts Server"
DAEMON=/opt/var/CalendarServer/ccs-calendarserver/bin/run

. /lib/lsb/init-functions

CALDAVD="/opt/var/CalendarServer/ccs-calendarserver/bin/run"
CALDAVD_USER="caldavd"
CALDAVD_OPTS="-n"
PIDFILE="/opt/caldavd/CalendarServer/ccs-calendarserver/caldavd.pid"
NAME=caldavd

test -x $CALDAVD || exit 0

case "$1" in
start)
log_daemon_msg "Starting Calendar Server" "$NAME"
if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --chuid $CALDAVD_USER --exec $CALDAVD -- $CALDAVD_OPTS; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping Calendar Server" "$NAME"
if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
log_daemon_msg "Restarting Calendar Server" "$NAME"
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --chuid $CALDAVD_USER --exec $CALDAVD -- $CALDAVD_OPTS; then
log_end_msg 0
else
log_end_msg 1
fi
;;
status)
status_of_proc -p "$CALDAVD" "$NAME" && exit 0 || exit $?
;;
*)
log_action_msg "Usage: /etc/init.d/caldavd {start|stop|restart|status}"
exit 1
esac

exit 0