Unison - init/upstart script
I am trying to get unison running as a socket service and have created an upstart script for that purpose.
Trouble is that clients cannot connect. The script is as follows:
---------
# upstart script to start unison socket service
# using port 2225
# this file should be named unison.conf
# it should be located in /etc/init/
description "unison service"
author "Alan Pater <email address hidden>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Start the process
exec unison -socket 2225
---------
I also tried an old school init.d script, clients connect to that, but it will not run at startup:
---------
#!/bin/sh
### BEGIN INIT INFO
# Provides: unison
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: control unison
### END INIT INFO
# Written by Kevin Swanson <kswantech.com>
UNISON_
UNISON_
. /lib/lsb/
case "$1" in
start)
log_daemon_msg "Starting Unison daemons"
start-stop-daemon --background --exec $UNISON_BIN --start -- $UNISON_ARGS
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping Unison daemons"
start-stop-daemon --exec $UNISON_BIN --stop
log_end_msg 0
;;
restart|
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: /etc/init.d/unison {start|
exit 1
;;
esac
exit 0
---------
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu unison Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Alan Pater
- Solved:
- Last query:
- Last reply: