[Pkg-iscsi-maintainers] Bug#810696: Please move state files from /var/ to /run

Martin Pitt martin.pitt at ubuntu.com
Mon Jan 11 11:23:31 UTC 2016


Package: open-iscsi
Version: 2.0.873+git0.3b4b4500-12
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch xenial

Hello,

open-iscsi still uses a lot of paths in /var/run and /var/lock/. These
have been symlinks to /run and /run/lock for many Debian releases now.
The problem with using those is that open-isci is typically used
during early boot, but /var might be mounted late (in setups where it
is a remote file system).

Colin Watson fixed this in Ubuntu's open-iscsi about five years ago. I
adjusted the patch to the current Debian version.

Thanks for considering,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/changelog open-iscsi-2.0.873+git0.3b4b4500/debian/changelog
--- open-iscsi-2.0.873+git0.3b4b4500/debian/changelog	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/changelog	2016-01-11 12:18:48.000000000 +0100
@@ -1,3 +1,10 @@
+open-iscsi (2.0.873+git0.3b4b4500-13) UNRELEASED; urgency=medium
+
+  * Migrate from /var/run /run and from /var/lock to /run/lock. This stops
+    depending on /var (which might be on a remote file system).
+
+ -- Martin Pitt <mpitt at debian.org>  Mon, 11 Jan 2016 12:17:42 +0100
+
 open-iscsi (2.0.873+git0.3b4b4500-12) unstable; urgency=low
 
   [ Christian Perrier ]
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/logout-all.sh open-iscsi-2.0.873+git0.3b4b4500/debian/extra/logout-all.sh
--- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/logout-all.sh	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/extra/logout-all.sh	2016-01-11 12:16:06.000000000 +0100
@@ -7,7 +7,7 @@
 #
 
 ISCSIADM=/sbin/iscsiadm
-PIDFILE=/var/run/iscsid.pid
+PIDFILE=/run/iscsid.pid
 
 ISCSI_ROOT_KEEP_ALL_SESSIONS_AT_SHUTDOWN=0
 if [ -f /etc/default/open-iscsi ]; then
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.init open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.init
--- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.init	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.init	2016-01-11 12:15:47.000000000 +0100
@@ -21,7 +21,7 @@
 
 DESC="iSCSI initiator daemon"
 DAEMON=/sbin/iscsid
-PIDFILE=/var/run/iscsid.pid
+PIDFILE=/run/iscsid.pid
 OMITDIR=/run/sendsigs.omit.d
 
 do_start_prepare() {
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service
--- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service	2016-01-11 12:15:39.000000000 +0100
@@ -10,7 +10,7 @@
 
 [Service]
 Type=forking
-PIDFile=/var/run/iscsid.pid
+PIDFile=/run/iscsid.pid
 ExecStartPre=/lib/open-iscsi/startup-checks.sh
 ExecStart=/sbin/iscsid
 ExecStop=/sbin/iscsiadm -k 0 2
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.init open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.init
--- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.init	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.init	2016-01-11 12:14:51.000000000 +0100
@@ -13,7 +13,7 @@
 PATH=/sbin:/bin
 DAEMON=/sbin/iscsid
 ADM=/sbin/iscsiadm
-PIDFILE=/var/run/iscsid.pid
+PIDFILE=/run/iscsid.pid
 NAMEFILE=/etc/iscsi/initiatorname.iscsi
 CONFIGFILE=/etc/iscsi/iscsid.conf
 OMITDIR=/run/sendsigs.omit.d
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition
--- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition	1970-01-01 01:00:00.000000000 +0100
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition	2016-01-11 12:17:39.000000000 +0100
@@ -0,0 +1,110 @@
+Description: Move from /var/lock and /var/run to /run/lock and /run
+Author: St?phane Graber <stgraber at ubuntu.com>
+
+Index: open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/doc/iscsid.8
++++ open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8
+@@ -40,7 +40,7 @@ do not write a process ID file.
+ .TP
+ .BI [-p|--pid=]\fIpid\-file\fP
+ write process ID to \fIpid\-file\fR rather than the default
+-\fI/var/run/iscsid.pid\fR
++\fI/run/iscsid.pid\fR
+ .TP
+ .BI [-h|--help]
+ display this help and exit
+Index: open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/usr/initiator.h
++++ open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h
+@@ -38,9 +38,9 @@
+ #define CONFIG_FILE		ISCSI_CONFIG_ROOT"iscsid.conf"
+ #define INITIATOR_NAME_FILE	ISCSI_CONFIG_ROOT"initiatorname.iscsi"
+ 
+-#define PID_FILE		"/var/run/iscsid.pid"
++#define PID_FILE		"/run/iscsid.pid"
+ #ifndef LOCK_DIR
+-#define LOCK_DIR		"/var/lock/iscsi"
++#define LOCK_DIR		"/run/lock/iscsi"
+ #endif
+ #define LOCK_FILE		LOCK_DIR"/lock"
+ #define LOCK_WRITE_FILE		LOCK_DIR"/lock.write"
+Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/paths.h
++++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h
+@@ -13,7 +13,7 @@
+ #define OPENISNS_VERSION_STRING		"0.90"
+ 
+ #define ISNS_ETCDIR			"/etc/isns"
+-#define ISNS_RUNDIR			"/var/run"
++#define ISNS_RUNDIR			"/run"
+ #define ISNS_DEFAULT_ISNSD_CONFIG	ISNS_ETCDIR "/isnsd.conf"
+ #define ISNS_DEFAULT_ISNSDD_CONFIG	ISNS_ETCDIR "/isnsdd.conf"
+ #define ISNS_DEFAULT_ISNSADM_CONFIG	ISNS_ETCDIR "/isnsadm.conf"
+Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/doc/isns_config.5
++++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5
+@@ -94,7 +94,7 @@ statically.
+ .TP
+ .BR PIDFile " (server):
+ This specifies the name of the server's PID file, which is
+-.B /var/run/isnsd.pid
++.B /run/isnsd.pid
+ by default.
+ .\" ------------------------------------------------------------------
+ .SS Database Related Options
+Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/etc/openisns.init
++++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init
+@@ -8,7 +8,7 @@
+ # description: Starts and stops the iSCSI isns server
+ #
+ # processname: isnsd
+-# pidfile: /var/run/isnsd.pid
++# pidfile: /run/isnsd.pid
+ # config:  /etc/isns/isnsd.conf
+ 
+ # Source function library.
+@@ -27,14 +27,14 @@ start()
+          success
+          echo
+          [ $RETVAL -eq 0 ] || return
+-         touch /var/lock/subsys/open-isns
++         touch /run/lock/subsys/open-isns
+ }
+ 
+ stop()
+ {
+          echo -n "Stopping iSCSI isns service: "
+          killproc isnsd
+-         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-isns
++         [ $RETVAL -eq 0 ] && rm -f /run/lock/subsys/open-isns
+          success
+          echo
+ 
+@@ -61,7 +61,7 @@ status)
+ 	RETVAL=$?
+ 	;;
+ condrestart)
+-	[ -f /var/lock/subsys/open-isns ] && restart
++	[ -f /run/lock/subsys/open-isns ] && restart
+ 	;;
+ *)
+ 	echo $"Usage: $0 {start|stop|restart|status|condrestart}"
+Index: open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c
+===================================================================
+--- open-iscsi-2.0.873+git0.3b4b4500.orig/iscsiuio/src/unix/main.c
++++ open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c
+@@ -76,7 +76,7 @@
+  ******************************************************************************/
+ #define PFX "main "
+ 
+-static const char default_pid_filepath[] = "/var/run/iscsiuio.pid";
++static const char default_pid_filepath[] = "/run/iscsiuio.pid";
+ 
+ /*******************************************************************************
+  *  Global Variables
diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series
--- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series	2015-10-21 11:49:30.000000000 +0200
+++ open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series	2016-01-11 12:14:07.000000000 +0100
@@ -3,3 +3,4 @@
 03_respect-build-flags.patch
 04_fix_iscsi_path.patch
 05-disable-iscsiuio.patch
+06_var-lock_var-run_transition
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-iscsi-maintainers/attachments/20160111/e2cc0775/attachment.sig>


More information about the Pkg-iscsi-maintainers mailing list