summaryrefslogtreecommitdiffstats
path: root/source/a/sysvinit/sysvinit.use_dev_initctl_not_run_initctl.diff
blob: 7b4ce97125aeb30ace5a4571e46ffb7fcc926aaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
--- ./src/shutdown.c.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./src/shutdown.c	2019-03-01 14:09:18.632719995 -0600
@@ -192,7 +192,7 @@
 
         /*
 	 *	Open the fifo and write the command.
-         *	Make sure we don't hang on opening /run/initctl
+         *	Make sure we don't hang on opening /dev/initctl
 	 */
 	memset(&sa, 0, sizeof(sa));
 	sa.sa_handler = alrm_handler;
--- ./src/Makefile.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./src/Makefile	2019-03-01 14:09:18.624719996 -0600
@@ -231,8 +231,8 @@
 		#
 		# This part is skipped on Debian systems, the
 		# debian.preinst script takes care of it.
-		@if [ ! -p /run/initctl ]; then \
-		 echo "Creating /run/initctl"; \
-		 rm -f /run/initctl; \
-		 mknod -m 600 /run/initctl p; fi
+		@if [ ! -p /dev/initctl ]; then \
+		 echo "Creating /dev/initctl"; \
+		 rm -f /dev/initctl; \
+		 mknod -m 600 /dev/initctl p; fi
 endif
--- ./src/initreq.h.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./src/initreq.h	2019-03-01 14:09:18.630719995 -0600
@@ -1,5 +1,5 @@
 /*
- * initreq.h	Interface to talk to init through /run/initctl.
+ * initreq.h	Interface to talk to init through /dev/initctl.
  *
  *		Copyright (C) 1995-2004 Miquel van Smoorenburg
  *
@@ -26,7 +26,7 @@
 #include <sys/param.h>
 
 #ifndef INIT_FIFO
-#define INIT_FIFO  "/run/initctl"
+#define INIT_FIFO  "/dev/initctl"
 #endif
 
 #define INIT_MAGIC 0x03091969
--- ./src/init.c.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./src/init.c	2019-03-01 14:09:18.629719995 -0600
@@ -146,7 +146,7 @@
 int maxproclen;			/* Maximal length of argv[0] with \0 */
 struct utmp utproto;		/* Only used for sizeof(utproto.ut_id) */
 char *console_dev;		/* Console device. */
-int pipe_fd = -1;		/* /run/initctl */
+int pipe_fd = -1;		/* /dev/initctl */
 int did_boot = 0;		/* Did we already do BOOT* stuff? */
 int main(int, char **);
 
@@ -2382,13 +2382,13 @@
   int			quit = 0;
 
   /*
-   *	First, try to create /run/initctl if not present.
+   *	First, try to create /dev/initctl if not present.
    */
   if (stat(INIT_FIFO, &st2) < 0 && errno == ENOENT)
 	(void)mkfifo(INIT_FIFO, 0600);
 
   /*
-   *	If /run/initctl is open, stat the file to see if it
+   *	If /dev/initctl is open, stat the file to see if it
    *	is still the _same_ inode.
    */
   if (pipe_fd >= 0) {
@@ -2402,7 +2402,7 @@
   }
 
   /*
-   *	Now finally try to open /run/initctl if pipe_fd is -1
+   *	Now finally try to open /dev/initctl if pipe_fd is -1
    *    if it is -2, then we leave it closed
    */
   if (pipe_fd == -1) {
@@ -2711,7 +2711,7 @@
   }
   if (ISMEMBER(got_signals, SIGUSR1)) {
 	/*
-	 *	SIGUSR1 means close and reopen /run/initctl
+	 *	SIGUSR1 means close and reopen /dev/initctl
 	 */
 	INITDBG(L_VB, "got SIGUSR1");
 	if (pipe_fd)
@@ -2959,7 +2959,7 @@
 			strerror(errno));
 
 	/* Open the fifo and write a command. */
-	/* Make sure we don't hang on opening /run/initctl */
+	/* Make sure we don't hang on opening /dev/initctl */
 	SETSIG(sa, SIGALRM, signal_handler, 0);
 	alarm(3);
 	if ((fd = open(INIT_FIFO, O_WRONLY)) >= 0) {
--- ./doc/initctl.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./doc/initctl	2019-03-01 14:09:18.614719997 -0600
@@ -1,5 +1,5 @@
 This document describes the communiction pipe set up by SysV init
-at /run/initctl. This named pipe allows programs with the proper
+at /dev/initctl. This named pipe allows programs with the proper
 permissions (typically programs run by root have read+write access to
 the pipe) to send signals to the init program (PID 1).
 
@@ -58,13 +58,13 @@
 might need to process our request. For example, when setting environment
 variables.
 
-When setting an environment variable through init's /run/initctl pipe,
+When setting an environment variable through init's /dev/initctl pipe,
 the data variable should have the format VARIABLE=VALUE. The string
 should be terminated with a NULL '\0' character.
 
 
 The following C code example shows how to send a set environment variable
-request to the init process using the /run/initctl pipe. This example
+request to the init process using the /dev/initctl pipe. This example
 is simplified and skips the error checking. A more comlpete example can be
 found in the shutdown.c program's init_setnv() function.
 
@@ -86,7 +86,7 @@
 
 
 
-Usually the /run/initctl pipe would only be used by low-level programs to
+Usually the /dev/initctl pipe would only be used by low-level programs to
 request a power-related shutdown or change the runlevel, like telinit
 would do. Most of the time there is no need to talk to init directly, but
 this gives us an extenable approach so init can be taught how to learn
--- ./doc/Install.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./doc/Install	2019-03-01 14:09:18.612719997 -0600
@@ -66,7 +66,7 @@
 manual page on shutdown to find out more about this.
 
 Running from a read-only file system (CDROM?):
-* All communication to init goes through the FIFO /run/initctl.
+* All communication to init goes through the FIFO /dev/initctl.
   There should be no problem using a read-only root file system
   If you use a Linux kernel > 1.3.66. Older kernels don't allow
   writing to a FIFO on a read-only file system.
--- ./man/init.8.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./man/init.8	2019-03-01 14:11:06.713711051 -0600
@@ -147,7 +147,7 @@
 the letter \fBF\fP.
 .PP
 Usage of \fBSIGPWR\fP and \fB/etc/powerstatus\fP is discouraged. Someone
-wanting to interact with \fBinit\fP should use the \fB/run/initctl\fP
+wanting to interact with \fBinit\fP should use the \fB/dev/initctl\fP
 control channel - see the initctl manual page for more documentation
 about this.
 .PP
@@ -258,7 +258,7 @@
 immediately exits with a return code of zero. 
 .PP
 .SH INTERFACE
-Init listens on a \fIfifo\fP in /dev, \fI/run/initctl\fP, for messages.
+Init listens on a \fIfifo\fP in /dev, \fI/dev/initctl\fP, for messages.
 \fBTelinit\fP uses this to communicate with init. The interface is not
 very well documented or finished. Those interested should study the
 \fIinitreq.h\fP file in the \fIsrc/\fP subdirectory of the \fBinit\fP
@@ -272,11 +272,11 @@
 .TP 0.5i
 .B SIGUSR1
 On receipt of this signals, init closes and re-opens its control fifo,
-\fB/run/initctl\fP. Useful for bootscripts when /dev is remounted.
+\fB/dev/initctl\fP. Useful for bootscripts when /dev is remounted.
 .TP 0.5i
 .B SIGUSR2
 When init receives SIGUSR2, init closes and leaves the control fifo,
-\fB/run/initctl\fP, closed. This may be used to make sure init is not
+\fB/dev/initctl\fP, closed. This may be used to make sure init is not
 holding open any files. However, it also prevents init from switching
 runlevels. Which means commands like shutdown no longer work.
 The fifo can be re-opened by sending init the SIGUSR1 signal.
@@ -304,7 +304,7 @@
 /dev/console
 /var/run/utmp
 /var/log/wtmp
-/run/initctl
+/dev/initctl
 .fi
 .\"}}}
 .\"{{{  Warnings
--- ./man/initctl.5.orig	2019-02-24 17:26:33.000000000 -0600
+++ ./man/initctl.5	2019-03-01 14:09:18.622719996 -0600
@@ -16,13 +16,13 @@
 .\"
 .TH INITCTL 5 "April 13, 2018" "" "Linux System Administrator's Manual"
 .SH NAME
-initctl \- /run/initctl is a named pipe which passes commands to SysV init.
+initctl \- /dev/initctl is a named pipe which passes commands to SysV init.
 .SH SYNOPSIS
-/run/initctl
+/dev/initctl
 .SH DESCRIPTION
 
 This document describes the communiction pipe set up by SysV init
-at /run/initctl. This named pipe allows programs with the proper
+at /dev/initctl. This named pipe allows programs with the proper
 permissions (typically programs run by root have read+write access to
 the pipe) to send signals to the init program (PID 1).
 
@@ -86,14 +86,14 @@
 might need to process our request. For example, when setting environment
 variables.
 
-When setting an environment variable through init's /run/initctl pipe,
+When setting an environment variable through init's /dev/initctl pipe,
 the data variable should have the format VARIABLE=VALUE. The string
 should be terminated with a NULL character.
 
 .SH EXAMPLES
 
 The following C code example shows how to send a set environment variable
-request to the init process using the /run/initctl pipe. This example
+request to the init process using the /dev/initctl pipe. This example
 is simplified and skips the error checking. A more comlpete example can be
 found in the shutdown.c program's init_setnv() function.
 
@@ -118,18 +118,18 @@
 .sp
 .RE
 .SH NOTES
-Usually the /run/initctl pipe would only be used by low-level programs to
+Usually the /dev/initctl pipe would only be used by low-level programs to
 request a power-related shutdown or change the runlevel, like telinit
 would do. Most of the time there is no need to talk to init directly, but
 this gives us an extenable approach so init can be taught how to learn
 more commands.
 .PP
-The commands passed through the /run/initctl pipe must be sent in a specific
+The commands passed through the /dev/initctl pipe must be sent in a specific
 binary format and be of a specific length. Larger data structures or ones
 not using the proper format will be ignored. Typically, only root has the
 ability to write to the initctl pipe for security reasons.
 .PP
-The /run/initctl pipe can be closed by sending init (PID 1) the SIGUSR2
+The /dev/initctl pipe can be closed by sending init (PID 1) the SIGUSR2
 signal. This closes the pipe and leaves it closed. This may be useful
 for making sure init is not keeping any files open. However, when the
 pipe is closed, init no longer receives signals, such as those sent by
@@ -137,12 +137,12 @@
 change its runlevel directly. The pipe may be re-opened by sending init (PID 1)
 the SIGUSR1 signal.
 .PP
-If the /run/initctl pipe is closed then it may still be possible to bring
+If the /dev/initctl pipe is closed then it may still be possible to bring
 down the system using the shutdown command's -n flag, but this is not
 always clean and not recommended.
 .RE
 .SH FILES
-/run/initctl
+/dev/initctl
 /sbin/init
 .SH AUTHOR
 Jesse Smith <jsmith@resonatingmedia.com>