------------------------------------------------------------
revno: 73
committer: Dimitri John Ledkov <[email protected]>
branch nick: upstart-jobs
timestamp: Wed 2014-04-30 12:14:33 +0100
message:
  auto update
added:
  lib/systemd/system/tlsdated.service
modified:
  etc/init.d/distributed-net
  etc/init.d/mysql
  etc/init.d/vz
  etc/init/edubuntu-server-manager.conf
  lib/systemd/system/thinkfan.service


--
lp:~upstart-devel/upstart/upstart-jobs
https://code.launchpad.net/~upstart-devel/upstart/upstart-jobs

Your team Upstart Reviewers is subscribed to branch 
lp:~upstart-devel/upstart/upstart-jobs.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/upstart-jobs/+edit-subscription
=== modified file 'etc/init.d/distributed-net'
--- etc/init.d/distributed-net	2014-04-09 00:24:49 +0000
+++ etc/init.d/distributed-net	2014-04-30 11:14:33 +0000
@@ -7,118 +7,164 @@
 # Should-Stop:       $network
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: Start and Shutdown the distributed.net client
+# Short-Description: Start the distributed.net client at boot time.
+# Description:       Execute the distributed.net client as a background daemon during boot
+#                    and provide an interface for controlling it which is consistent with
+#                    other system services.
 ### END INIT INFO
 #
 # Notes:
-#   - distributed.net likes to do startup and shutdown its own way and 
-#     doesn't use pid files.  Running as user daemon makes it difficult
-#     to generate pid files.  It appears that dnetc starts a seperate 
-#     process to do the crunching, which makes any pid returned by the 
-#     shell invalid.
-#   - When instructed to shutdown dnetc takes a few seconds to clean up.
-#     We should wait for it to finish, however since the stop is normally
-#     executed as part of a system shutdown, we can't wait forever.  So 
-#     we'll wait for up to 30 seconds.
+#   - distributed.net does not like to play nicely with init scripts.  It needs to be run
+#     without the -quiet option.  Otherwise it will detach from the shell and there will
+#     be no way to determine its PID.  
 #
 # This script was originally written by: [email protected], 2001-12-16.
-# James Stark <[email protected]>, 2006-10-22
+# James Stark <[email protected]>, 2014-02-23
 
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="distributed.net client"
+NAME=distributed-net
 DAEMON="/usr/bin/dnetc"
-INIFILE="/etc/distributed-net.conf"
-LOGFILE="/var/log/distributed-net.log"
+DAEMON_ARGS=""
+PIDFILE="/var/run/$NAME.pid"
+LOGFILE="/var/log/$NAME.log"
+CONFFILE="/etc/$NAME.conf"
+SCRIPTNAME="/etc/init.d/$NAME"
+BUFFIN="/var/lib/distributed-net/buff-in"
+BUFFOUT="/var/lib/distributed-net/buff-out"
 
 dnetc_opts=""
 
-if [ -r /etc/default/distributed-net ]; then
-	. /etc/default/distributed-net
-fi
-
-OPTIONS="-quiet -ini $INIFILE -l $LOGFILE -inbase /var/lib/distributed-net/buff-in -outbase /var/lib/distributed-net/buff-out $dnetc_opts"
-
-test -x $DAEMON || exit 0
-
-export PATH="${PATH:+"$PATH:"}/usr/sbin:/sbin"
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions
+. /lib/lsb/init-functions
+
+# Build up the full list of arguments to the distributed.net client
+DAEMON_ARGS="$DAEMON_ARGS -ini $CONFFILE -l $LOGFILE -inbase $BUFFIN -outbase $BUFFOUT $dnetc_opts"
+
+#
+# Attempt to start the distributed-net client.  The client will only be started
+# if the configuration file is present and it is not already running.  Once the
+# client has been successfully started set the scheduling priority to
+# SCHED_IDLE for the client and all of its sub-processes.
+#
+do_start ()
+{
+	result=0 
+
+	if [ -e /etc/distributed-net.conf ]; then
+		if start-stop-daemon --start --quiet --user daemon --group daemon --pidfile $PIDFILE --exec $DAEMON --test > /dev/null; then
+			chrt -i -p 0 $$
+			start-stop-daemon --start --quiet --user daemon --group daemon --pidfile $PIDFILE --exec $DAEMON --chuid daemon:daemon --chdir /var/lib/$NAME/ --background --make-pidfile -- $DAEMON_ARGS || retval=2
+		else
+			result=1
+		fi
+	else
+		log_failure_msg "distributed-net is not configured please run:  dpkg-reconfigure distributed-net"
+		result=2
+	fi
+
+	return $result
+}
+
+#
+# Shutdown the distributed.net client. It should clean up all of this children.
+#
+do_stop ()
+{
+	start-stop-daemon --stop --quiet --user daemon --group daemon --pidfile $PIDFILE --name "dnetc" --retry=TERM/30/KILL/5
+	rm $PIDFILE
+
+	return $?
+}
+
+#
+# Perform various client actions like updating buffers.  The name of the client
+# option is passed as an argument.  Since the distributed.net client is its own
+# control program, start-stop-daemon will refuse to execute any of these actions
+# as the client will already be running.  Therefore the action will be performed
+# using su.
+#
+do_action ()
+{
+	result=0
+
+	if cd /var/lib/distributed-net; then
+		if start-stop-daemon --stop --quiet --signal 0 --user daemon --group daemon --name "dnetc" 2> /dev/null; then
+			su daemon -s /bin/sh -c "$DAEMON $DAEMON_ARGS -$1"
+		else
+			result=2
+		fi
+	else
+		result=2
+	fi
+
+	return $result
+}
 
 case "$1" in
 	start)
-		echo -n "Starting distributed.net client: distributed-net"
-		cd /var/lib/distributed-net || exit 1
-		
-		# only start the deamon if it's not already running.  
-		# start-stop-daemon doesn't support switching users, so we'll only
-		# use it to check for a running process.
-		if start-stop-daemon --quiet --stop --signal 0 --user daemon --name dnetc 2>/dev/null; then
-			echo " already running."
-		else
-			su daemon -s /bin/sh -c "chrt -b 0 $DAEMON $OPTIONS"
-			echo "."
-		fi
+		[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+		do_start
+		case "$?" in
+			0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		esac
 		;;
 	stop)
-		echo -n "Stopping distributed.net client: distributed-net"
-		cd /var/lib/distributed-net || exit 1
-
-		# only stop the deamon if it's running.  
-		# dnetc wants to use its own shutdown command, so start-stop-deamon
-		# is  only used to ckeck for the running process.
-		if start-stop-daemon --quiet --stop --signal 0 --user daemon --name dnetc 2>/dev/null; then
-			su daemon -s /bin/sh -c "$DAEMON $OPTIONS -shutdown" > /dev/null 2>&1
-
-			# wait for upto 10s for dnetc to stop.
-			WAIT=0
-			while start-stop-daemon --quiet --stop --signal 0 --user daemon --name dnetc 2>/dev/null && [ $WAIT -lt 30 ]; do
-				sleep 1
-				WAIT=`expr $WAIT + 1`
-			done
-
-			# If we timeout of the wait loop send any remaining dnetc 
-			# processes SIGKILL to make sure that they terminate.
-			if [ $WAIT -eq 30 ]; then
-				start-stop-daemon --quiet --stop --signal 9 --user daemon --name dnetc
-			fi
-
-			echo "."
-		else
-			echo " not running."
-		fi
-		;;
-	restart)
-		$0 stop
-		$0 start
-		;;
-	reload)
-		# if dnetc is running have it HUP itself, otherwise do nothing.
-		if start-stop-daemon --quiet --stop --signal 0 --user daemon --name dnetc 2>/dev/null; then
-			su daemon -s /bin/sh -c "$DAEMON $OPTIONS -restart" 2> /dev/null
-		fi
-		;;
-	force-reload)
-		# if dnetc is running have it HUP itself, otherwise start it.
-		if start-stop-daemon --quiet --stop --signal 0 --user daemon --name dnetc 2>/dev/null; then
-			su daemon -s /bin/sh -c "$DAEMON $OPTIONS -restart" 2> /dev/null
-		else
-			$0 start
-		fi
+		[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+		do_stop
+		case "$?" in
+			0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+			2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		esac
+		;;
+	status)
+		status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+		;;
+	restart|force-reload)
+		log_daemon_msg "Restarting $DESC" "$NAME"
+		do_stop
+		case "$?" in
+			0|1)
+				do_start
+				case "$?" in
+					0) log_end_msg 0 ;;
+					1) log_end_msg 1 ;; # Old process is still running
+					*) log_end_msg 1 ;; # Failed to start
+				esac
+				;;
+			*)
+				log_end_msg 1 ;; # Failed to stop
+		esac
 		;;
 	fetch)
-		echo -n "distributed.net: Fetching blocks"
-		cd /var/lib/distributed-net || exit 1
-		su daemon -s /bin/sh -c "$DAEMON $OPTIONS -fetch"
+		log_daemon_msg "$DESC Fetching blocks"
+		do_action "fetch"
+		log_end_msg 0
 		;;
 	flush)
-		echo -n "distributed.net: Flushing blocks"
-		cd /var/lib/distributed-net || exit 1
-		su daemon -s /bin/sh -c "$DAEMON $OPTIONS -flush"
+		log_daemon_msg "$DESC Flushing blocks"
+		do_action "flush"
+		log_end_msg 0
 		;;
 	update)
-		echo -n "distributed.net: Updating blocks"
-		cd /var/lib/distributed-net || exit 1
-		su daemon -s /bin/sh -c "$DAEMON $OPTIONS -update"
+		log_daemon_msg "$DESC Updating blocks"
+		do_action "update"
+		log_end_msg 0
 		;;
 	*)
-		echo "Usage: /etc/init.d/distributed-net {start|stop|restart|force-reload|fetch|flush|update}"
-		exit 1
+		echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload|fetch|flush|update}" >&3
+		exit 3
+		;;
 esac
 
 exit 0

=== modified file 'etc/init.d/mysql'
--- etc/init.d/mysql	2014-04-09 00:24:49 +0000
+++ etc/init.d/mysql	2014-04-30 11:14:33 +0000
@@ -4,12 +4,12 @@
 # Provides:          mysql
 # Required-Start:    $remote_fs $syslog
 # Required-Stop:     $remote_fs $syslog
-# Should-Start:      $network $time
-# Should-Stop:       $network $time
+# Should-Start:      $network $named $time
+# Should-Stop:       $network $named $time
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: Start and stop the mysql database server daemon
-# Description:       Controls the main MySQL database server daemon "mysqld"
+# Description:       Controls the main MariaDB database server daemon "mysqld"
 #                    and its wrapper script "mysqld_safe".
 ### END INIT INFO
 #
@@ -17,7 +17,7 @@
 set -u
 ${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
 
-test -x /usr/bin/mysqld_safe || exit 0
+test -x /usr/sbin/mysqld || exit 0
 
 . /lib/lsb/init-functions
 
@@ -97,7 +97,7 @@
   'start')
 	sanity_checks;
 	# Start daemon
-	log_daemon_msg "Starting MySQL database server" "mysqld"
+	log_daemon_msg "Starting MariaDB database server" "mysqld"
 	if mysqld_status check_alive nowarn; then
 	   log_progress_msg "already running"
 	   log_end_msg 0
@@ -105,12 +105,11 @@
 	    # Could be removed during boot
 	    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
 
-	    # Start MySQL! 
-  	    su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &"
+	    # Start MariaDB!
+  	    /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER &
 
 	    # 6s was reported in #352070 to be too few when using ndbcluster
-	    # 14s was reported in #736452 to be too few with large installs
-	    for i in $(seq 1 30); do
+	    for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do
                 sleep 1
 	        if mysqld_status check_alive nowarn ; then break; fi
 		log_progress_msg "."
@@ -132,7 +131,7 @@
 	# at least for cron, we can rely on it here, too. (although we have 
 	# to specify it explicit as e.g. sudo environments points to the normal
 	# users home and not /root)
-	log_daemon_msg "Stopping MySQL database server" "mysqld"
+	log_daemon_msg "Stopping MariaDB database server" "mysqld"
 	if ! mysqld_status check_dead nowarn; then
 	  set +e
 	  shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
@@ -140,10 +139,10 @@
 	  if [ "$r" -ne 0 ]; then
 	    log_end_msg 1
 	    [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
-	    log_daemon_msg "Killing MySQL database server by signal" "mysqld"
+	    log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
 	    killall -15 mysqld
             server_down=
-	    for i in 1 2 3 4 5 6 7 8 9 10; do
+	    for i in `seq 1 600`; do
               sleep 1
               if mysqld_status check_dead nowarn; then server_down=1; break; fi
             done
@@ -153,7 +152,7 @@
 
         if ! mysqld_status check_dead warn; then
 	  log_end_msg 1
-	  log_failure_msg "Please stop MySQL manually and read /usr/share/doc/mysql-server-5.6/README.Debian.gz!"
+	  log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-5.5/README.Debian.gz!"
 	  exit -1
 	else
 	  log_end_msg 0
@@ -162,11 +161,11 @@
 
   'restart')
 	set +e; $SELF stop; set -e
-	$SELF start 
+	$SELF start "${@}"
 	;;
 
   'reload'|'force-reload')
-  	log_daemon_msg "Reloading MySQL database server" "mysqld"
+  	log_daemon_msg "Reloading MariaDB database server" "mysqld"
 	$MYADMIN reload
 	log_end_msg 0
 	;;
@@ -175,7 +174,7 @@
 	if mysqld_status check_alive nowarn; then
 	  log_action_msg "$($MYADMIN version)"
 	else
-	  log_action_msg "MySQL is stopped."
+	  log_action_msg "MariaDB is stopped."
 	  exit 3
 	fi
   	;;

=== modified file 'etc/init.d/vz'
--- etc/init.d/vz	2014-04-09 00:24:49 +0000
+++ etc/init.d/vz	2014-04-30 11:14:33 +0000
@@ -64,7 +64,13 @@
 	if [ "${VZWDOG}" = "yes" ]; then
 		MODULES="${MODULES} vzwdog"
 	fi
-	test -z "$IPTABLES_MODULES" && IPTABLES_MODULES="$IPTABLES"
+	if [ -z "$IPTABLES_MODULES" ]; then
+		if [ -n "$IPTABLES" ]; then
+			echo "WARNING: IPTABLES in vz.conf is obsoleted, " 1>&2
+			echo "please use IPTABLES_MODULES instead" 1>&2
+			IPTABLES_MODULES="$IPTABLES"
+		fi
+	fi
 	IPT_MODULES="ip_tables ${IPTABLES_MODULES} xt_tcpudp"
 	if [ "${IPV6}" = "yes" ]; then
 		IPT_MODULES="${IPT_MODULES} ${IP6TABLES}"
@@ -163,24 +169,6 @@
 	[ -f $SUBSYS_VZ ] || return 1
 }
 
-modify_vzconf()
-{
-	# For vswap-enabled kernel (like RHEL6 042test or greater),
-	# use vswap config for CT. Don't do it if CONFIGFILE= is modified
-
-	egrep -q 'test|stab' /proc/vz/version 2>/dev/null || return 0
-
-	local cfg_old='^CONFIGFILE="basic" # Use vswap-256m on RHEL6 kernel$'
-	local cfg_new='CONFIGFILE="vswap-256m"'
-	local kv=$(cat /proc/vz/version | sed 's/\(test\|stab\).*$//')
-	if test $kv -ge 42; then
-		if grep -q "$cfg_old" $VZCONF; then
-			sed -i "s/${cfg_old}/${cfg_new}/" $VZCONF
-			print_warning "Setting $cfg_new in $VZCONF"
-		fi
-	fi
-}
-
 # Add /vz to PRUNEPATHS in /etc/updatedb.conf so updatedb won't:
 # 1 clog its database with lots of file entries
 # 2 interfere with vzctl umount
@@ -516,7 +504,6 @@
 
 	start_net
 	setup_ve0
-	modify_vzconf
 	fix_updatedb
 	start_ves
 

=== modified file 'etc/init/edubuntu-server-manager.conf'
--- etc/init/edubuntu-server-manager.conf	2013-11-18 12:42:03 +0000
+++ etc/init/edubuntu-server-manager.conf	2014-04-30 11:14:33 +0000
@@ -6,7 +6,7 @@
 description     "Edubuntu Server"
 author          "Stéphane Graber <[email protected]>"
 
-start on net-static-up
+start on static-network-up
 stop on runlevel [!2345]
 
 respawn

=== modified file 'lib/systemd/system/thinkfan.service'
--- lib/systemd/system/thinkfan.service	2014-04-09 00:26:24 +0000
+++ lib/systemd/system/thinkfan.service	2014-04-30 11:14:33 +0000
@@ -6,7 +6,7 @@
 Type=forking
 ExecStart=/usr/sbin/thinkfan
 PIDFile=/var/run/thinkfan.pid
-ExecReload=/bin/kill -HUP $(cat /var/run/thinkfan.pid)
+ExecReload=/bin/kill -HUP $MAINPID
 
 [Install]
 WantedBy=multi-user.target

=== added file 'lib/systemd/system/tlsdated.service'
--- lib/systemd/system/tlsdated.service	1970-01-01 00:00:00 +0000
+++ lib/systemd/system/tlsdated.service	2014-04-30 11:14:33 +0000
@@ -0,0 +1,6 @@
+[Unit]
+Description=Secure parasitic rdate replacement
+
+[Service]
+ExecStart=/usr/bin/tlsdated
+Type=forking

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to