Browse code

Upgrade systemd to v221

Vinay Kulkarni authored on 2015/08/11 14:27:38
Showing 5 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,746 @@
0
+#!/bin/sh
1
+########################################################################
2
+# 
3
+# Begin /lib/lsb/init-funtions
4
+#
5
+# Description : Run Level Control Functions
6
+#
7
+# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
8
+#             : DJ Lucas - dj@linuxfromscratch.org
9
+# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
10
+#
11
+# Version     : LFS 7.0
12
+#
13
+# Notes       : With code based on Matthias Benkmann's simpleinit-msb
14
+#               http://winterdrache.de/linux/newboot/index.html
15
+#
16
+#               The file should be located in /lib/lsb
17
+#
18
+########################################################################
19
+
20
+## Environmental setup
21
+# Setup default values for environment
22
+umask 022
23
+export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
24
+
25
+## Screen Dimensions
26
+# Find current screen size
27
+if [ -z "${COLUMNS}" ]; then
28
+   COLUMNS=$(stty size)
29
+   COLUMNS=${COLUMNS##* }
30
+fi
31
+
32
+# When using remote connections, such as a serial port, stty size returns 0
33
+if [ "${COLUMNS}" = "0" ]; then
34
+   COLUMNS=80
35
+fi
36
+
37
+## Measurements for positioning result messages
38
+COL=$((${COLUMNS} - 8))
39
+WCOL=$((${COL} - 2))
40
+
41
+## Set Cursor Position Commands, used via echo
42
+SET_COL="\\033[${COL}G"      # at the $COL char
43
+SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
44
+CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
45
+
46
+## Set color commands, used via echo
47
+# Please consult `man console_codes for more information
48
+# under the "ECMA-48 Set Graphics Rendition" section
49
+#
50
+# Warning: when switching from a 8bit to a 9bit font,
51
+# the linux console will reinterpret the bold (1;) to
52
+# the top 256 glyphs of the 9bit font.  This does
53
+# not affect framebuffer consoles
54
+
55
+NORMAL="\\033[0;39m"         # Standard console grey
56
+SUCCESS="\\033[1;32m"        # Success is green
57
+WARNING="\\033[1;33m"        # Warnings are yellow
58
+FAILURE="\\033[1;31m"        # Failures are red
59
+INFO="\\033[1;36m"           # Information is light cyan
60
+BRACKET="\\033[1;34m"        # Brackets are blue
61
+
62
+BOOTLOG=/run/var/bootlog
63
+KILLDELAY=3
64
+
65
+# Set any user specified environment variables e.g. HEADLESS
66
+[ -r /etc/sysconfig/rc.site ]  && . /etc/sysconfig/rc.site
67
+
68
+################################################################################
69
+# start_daemon()                                                               #
70
+# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...]      #
71
+#                                                                              #
72
+# Purpose: This runs the specified program as a daemon                         #
73
+#                                                                              #
74
+# Inputs: -f: (force) run the program even if it is already running.           #
75
+#         -n nicelevel: specify a nice level. See 'man nice(1)'.               #
76
+#         -p pidfile: use the specified file to determine PIDs.                #
77
+#         pathname: the complete path to the specified program                 #
78
+#         args: additional arguments passed to the program (pathname)          #
79
+#                                                                              #
80
+# Return values (as defined by LSB exit codes):                                #
81
+#       0 - program is running or service is OK                                #
82
+#       1 - generic or unspecified error                                       #
83
+#       2 - invalid or excessive argument(s)                                   #
84
+#       5 - program is not installed                                           #
85
+################################################################################
86
+start_daemon()
87
+{
88
+    local force=""
89
+    local nice="0"
90
+    local pidfile=""
91
+    local pidlist=""
92
+    local retval=""
93
+
94
+    # Process arguments
95
+    while true
96
+    do
97
+        case "${1}" in
98
+
99
+            -f)
100
+                force="1"
101
+                shift 1
102
+                ;;
103
+
104
+            -n)
105
+                nice="${2}"
106
+                shift 2
107
+                ;;
108
+
109
+            -p)
110
+                pidfile="${2}"
111
+                shift 2
112
+                ;;
113
+
114
+            -*)
115
+                return 2
116
+                ;;
117
+
118
+            *)
119
+                program="${1}"
120
+                break
121
+                ;;
122
+        esac
123
+    done
124
+
125
+    # Check for a valid program
126
+    if [ ! -e "${program}" ]; then return 5; fi
127
+
128
+    # Execute
129
+    if [ -z "${force}" ]; then
130
+        if [ -z "${pidfile}" ]; then
131
+            # Determine the pid by discovery
132
+            pidlist=`pidofproc "${1}"`
133
+            retval="${?}"
134
+        else
135
+            # The PID file contains the needed PIDs
136
+            # Note that by LSB requirement, the path must be given to pidofproc,
137
+            # however, it is not used by the current implementation or standard.
138
+            pidlist=`pidofproc -p "${pidfile}" "${1}"`
139
+            retval="${?}"
140
+        fi
141
+
142
+        # Return a value ONLY 
143
+        # It is the init script's (or distribution's functions) responsibilty
144
+        # to log messages!
145
+        case "${retval}" in
146
+
147
+            0)
148
+                # Program is already running correctly, this is a 
149
+                # succesful start.
150
+                return 0
151
+                ;;
152
+
153
+            1)
154
+                # Program is not running, but an invalid pid file exists
155
+                # remove the pid file and continue
156
+                rm -f "${pidfile}"
157
+                ;;
158
+
159
+            3)
160
+                # Program is not running and no pidfile exists
161
+                # do nothing here, let start_deamon continue.
162
+                ;;
163
+
164
+            *)
165
+                # Others as returned by status values shall not be interpreted
166
+                # and returned as an unspecified error.
167
+                return 1
168
+                ;;
169
+        esac
170
+    fi
171
+
172
+    # Do the start!
173
+
174
+    nice -n "${nice}" "${@}"
175
+}
176
+
177
+################################################################################
178
+# killproc()                                                                   #
179
+# Usage: killproc [-p pidfile] pathname [signal]                               #
180
+#                                                                              #
181
+# Purpose: Send control signals to running processes                           #
182
+#                                                                              #
183
+# Inputs: -p pidfile, uses the specified pidfile                               #
184
+#         pathname, pathname to the specified program                          #
185
+#         signal, send this signal to pathname                                 #
186
+#                                                                              #
187
+# Return values (as defined by LSB exit codes):                                #
188
+#       0 - program (pathname) has stopped/is already stopped or a             #
189
+#           running program has been sent specified signal and stopped         #
190
+#           successfully                                                       #
191
+#       1 - generic or unspecified error                                       #
192
+#       2 - invalid or excessive argument(s)                                   #
193
+#       5 - program is not installed                                           #
194
+#       7 - program is not running and a signal was supplied                   #
195
+################################################################################
196
+killproc()
197
+{
198
+    local pidfile
199
+    local program
200
+    local prefix
201
+    local progname
202
+    local signal="-TERM"
203
+    local fallback="-KILL"
204
+    local nosig
205
+    local pidlist
206
+    local retval
207
+    local pid
208
+    local delay="30"
209
+    local piddead
210
+    local dtime
211
+
212
+    # Process arguments
213
+    while true; do
214
+        case "${1}" in
215
+            -p)
216
+                pidfile="${2}"
217
+                shift 2
218
+                ;;
219
+ 
220
+             *)
221
+                 program="${1}"
222
+                 if [ -n "${2}" ]; then
223
+                     signal="${2}"
224
+                     fallback=""
225
+                 else
226
+                     nosig=1
227
+                 fi
228
+
229
+                 # Error on additional arguments
230
+                 if [ -n "${3}" ]; then
231
+                     return 2
232
+                 else 
233
+                     break
234
+                 fi                 
235
+                 ;;
236
+        esac
237
+    done
238
+
239
+    # Check for a valid program
240
+    if [ ! -e "${program}" ]; then return 5; fi
241
+
242
+    # Check for a valid signal
243
+    check_signal "${signal}"
244
+    if [ "${?}" -ne "0" ]; then return 2; fi
245
+
246
+    # Get a list of pids
247
+    if [ -z "${pidfile}" ]; then
248
+        # determine the pid by discovery
249
+        pidlist=`pidofproc "${1}"`
250
+        retval="${?}"
251
+    else
252
+        # The PID file contains the needed PIDs
253
+        # Note that by LSB requirement, the path must be given to pidofproc,
254
+        # however, it is not used by the current implementation or standard.
255
+        pidlist=`pidofproc -p "${pidfile}" "${1}"`
256
+        retval="${?}"
257
+    fi
258
+
259
+    # Return a value ONLY
260
+    # It is the init script's (or distribution's functions) responsibilty
261
+    # to log messages!
262
+    case "${retval}" in
263
+
264
+        0)
265
+            # Program is running correctly
266
+            # Do nothing here, let killproc continue.
267
+            ;;
268
+
269
+        1)
270
+            # Program is not running, but an invalid pid file exists
271
+            # Remove the pid file.
272
+            rm -f "${pidfile}"
273
+
274
+            # This is only a success if no signal was passed.
275
+            if [ -n "${nosig}" ]; then
276
+                return 0
277
+            else
278
+                return 7
279
+            fi
280
+            ;;
281
+
282
+        3)
283
+            # Program is not running and no pidfile exists
284
+            # This is only a success if no signal was passed.
285
+            if [ -n "${nosig}" ]; then
286
+                return 0
287
+            else
288
+                return 7
289
+            fi
290
+            ;;
291
+
292
+        *)
293
+            # Others as returned by status values shall not be interpreted
294
+            # and returned as an unspecified error.
295
+            return 1
296
+            ;;
297
+    esac
298
+
299
+    # Perform different actions for exit signals and control signals
300
+    check_sig_type "${signal}"
301
+
302
+    if [ "${?}" -eq "0" ]; then # Signal is used to terminate the program
303
+
304
+        # Account for empty pidlist (pid file still exists and no 
305
+        # signal was given)
306
+        if [ "${pidlist}" != "" ]; then
307
+
308
+            # Kill the list of pids
309
+            for pid in ${pidlist}; do
310
+
311
+                kill -0 "${pid}" 2> /dev/null
312
+
313
+                if [ "${?}" -ne "0" ]; then
314
+                    # Process is dead, continue to next and assume all is well
315
+                    continue
316
+                else
317
+                    kill "${signal}" "${pid}" 2> /dev/null
318
+
319
+                    # Wait up to ${delay}/10 seconds to for "${pid}" to 
320
+                    # terminate in 10ths of a second
321
+
322
+                    while [ "${delay}" -ne "0" ]; do
323
+                        kill -0 "${pid}" 2> /dev/null || piddead="1"
324
+                        if [ "${piddead}" = "1" ]; then break; fi
325
+                        sleep 0.1
326
+                        delay="$(( ${delay} - 1 ))"
327
+                    done
328
+
329
+                    # If a fallback is set, and program is still running, then
330
+                    # use the fallback
331
+                    if [ -n "${fallback}" -a "${piddead}" != "1" ]; then
332
+                        kill "${fallback}" "${pid}" 2> /dev/null
333
+                        sleep 1
334
+                        # Check again, and fail if still running
335
+                        kill -0 "${pid}" 2> /dev/null && return 1
336
+                    else
337
+                        # just check one last time and if still alive, fail
338
+                        sleep 1
339
+                        kill -0 "${pid}" 2> /dev/null && return 1
340
+                    fi
341
+                fi
342
+            done
343
+        fi
344
+
345
+        # Check for and remove stale PID files.
346
+        if [ -z "${pidfile}" ]; then
347
+            # Find the basename of $program
348
+            prefix=`echo "${program}" | sed 's/[^/]*$//'`
349
+            progname=`echo "${program}" | sed "s@${prefix}@@"`
350
+
351
+            if [ -e "/var/run/${progname}.pid" ]; then
352
+                rm -f "/var/run/${progname}.pid" 2> /dev/null
353
+            fi
354
+        else
355
+            if [ -e "${pidfile}" ]; then rm -f "${pidfile}" 2> /dev/null; fi
356
+        fi
357
+
358
+    # For signals that do not expect a program to exit, simply
359
+    # let kill do it's job, and evaluate kills return for value
360
+
361
+    else # check_sig_type - signal is not used to terminate program
362
+        for pid in ${pidlist}; do
363
+            kill "${signal}" "${pid}"
364
+            if [ "${?}" -ne "0" ]; then return 1; fi
365
+        done
366
+    fi
367
+}
368
+
369
+################################################################################
370
+# pidofproc()                                                                  #
371
+# Usage: pidofproc [-p pidfile] pathname                                       #
372
+#                                                                              #
373
+# Purpose: This function returns one or more pid(s) for a particular daemon    #
374
+#                                                                              #
375
+# Inputs: -p pidfile, use the specified pidfile instead of pidof               #
376
+#         pathname, path to the specified program                              #
377
+#                                                                              #
378
+# Return values (as defined by LSB status codes):                              #
379
+#       0 - Success (PIDs to stdout)                                           #
380
+#       1 - Program is dead, PID file still exists (remaining PIDs output)     #
381
+#       3 - Program is not running (no output)                                 #
382
+################################################################################
383
+pidofproc()
384
+{
385
+    local pidfile
386
+    local program
387
+    local prefix
388
+    local progname
389
+    local pidlist
390
+    local lpids
391
+    local exitstatus="0"
392
+
393
+    # Process arguments
394
+    while true; do
395
+        case "${1}" in
396
+
397
+            -p)
398
+                pidfile="${2}"
399
+                shift 2
400
+                ;;
401
+
402
+            *)
403
+                program="${1}"
404
+                if [ -n "${2}" ]; then
405
+                    # Too many arguments
406
+                    # Since this is status, return unknown
407
+                    return 4
408
+                else
409
+                    break
410
+                fi
411
+                ;;
412
+        esac
413
+    done
414
+
415
+    # If a PID file is not specified, try and find one.
416
+    if [ -z "${pidfile}" ]; then
417
+        # Get the program's basename
418
+        prefix=`echo "${program}" | sed 's/[^/]*$//'`
419
+
420
+        if [ -z "${prefix}" ]; then 
421
+           progname="${program}"
422
+        else
423
+           progname=`echo "${program}" | sed "s@${prefix}@@"`
424
+        fi
425
+
426
+        # If a PID file exists with that name, assume that is it.
427
+        if [ -e "/var/run/${progname}.pid" ]; then
428
+            pidfile="/var/run/${progname}.pid"
429
+        fi
430
+    fi
431
+
432
+    # If a PID file is set and exists, use it.
433
+    if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
434
+
435
+        # Use the value in the first line of the pidfile
436
+        pidlist=`/bin/head -n1 "${pidfile}"`
437
+        # This can optionally be written as 'sed 1q' to repalce 'head -n1'
438
+        # should LFS move /bin/head to /usr/bin/head
439
+    else
440
+        # Use pidof
441
+        pidlist=`pidof "${program}"`
442
+    fi
443
+
444
+    # Figure out if all listed PIDs are running.
445
+    for pid in ${pidlist}; do
446
+        kill -0 ${pid} 2> /dev/null
447
+
448
+        if [ "${?}" -eq "0" ]; then
449
+            lpids="${pids}${pid} "
450
+        else
451
+            exitstatus="1"
452
+        fi
453
+    done
454
+
455
+    if [ -z "${lpids}" -a ! -f "${pidfile}" ]; then
456
+        return 3
457
+    else
458
+        echo "${lpids}"
459
+        return "${exitstatus}"
460
+    fi
461
+}
462
+
463
+################################################################################
464
+# statusproc()                                                                 #
465
+# Usage: statusproc [-p pidfile] pathname                                      #
466
+#                                                                              #
467
+# Purpose: This function prints the status of a particular daemon to stdout    #
468
+#                                                                              #
469
+# Inputs: -p pidfile, use the specified pidfile instead of pidof               #
470
+#         pathname, path to the specified program                              #
471
+#                                                                              #
472
+# Note: Output to stdout.  Not logged.                                         #
473
+#                                                                              #
474
+# Return values:                                                               #
475
+#       0 - Status printed                                                     #
476
+#       1 - Input error. The daemon to check was not specified.                #
477
+################################################################################
478
+statusproc()
479
+{
480
+   if [ "${#}" = "0" ]; then
481
+      echo "Usage: statusproc {program}"
482
+      exit 1
483
+   fi
484
+
485
+    local pidfile
486
+    local pidlist
487
+
488
+    # Process arguments
489
+    while true; do
490
+      case "${1}" in
491
+
492
+          -p)
493
+              pidfile="${2}"
494
+              shift 2
495
+              ;;
496
+      esac
497
+   done
498
+
499
+   if [ -z "${pidfile}" ]; then
500
+      pidlist=`pidofproc -p "${pidfile}" $@`
501
+   else
502
+      pidlist=`pidofproc $@`
503
+   fi
504
+
505
+   # Trim trailing blanks
506
+   pidlist=`echo "${pidlist}" | sed -r 's/ +$//'`
507
+
508
+   base="${1##*/}"
509
+
510
+   if [ -n "${pidlist}" ]; then
511
+      echo -e "${INFO}${base} is running with Process" \
512
+         "ID(s) ${pidlist}.${NORMAL}"
513
+   else
514
+      if [ -n "${base}" -a -e "/var/run/${base}.pid" ]; then
515
+         echo -e "${WARNING}${1} is not running but" \
516
+            "/var/run/${base}.pid exists.${NORMAL}"
517
+      else
518
+         if [ -z "${pidlist}" -a -n "${pidfile}" ]; then
519
+            echo -e "${WARNING}${1} is not running" \
520
+               "but ${pidfile} exists.${NORMAL}"
521
+         else
522
+            echo -e "${INFO}${1} is not running.${NORMAL}"
523
+         fi
524
+      fi
525
+   fi
526
+}
527
+
528
+################################################################################
529
+# timespec()                                                                   #
530
+#                                                                              #
531
+# Purpose: An internal utility function to format a timestamp                  #
532
+#          a boot log file.  Sets the STAMP variable.                          #
533
+#                                                                              #
534
+# Return value: Not used                                                       #
535
+################################################################################
536
+timespec()
537
+{
538
+   STAMP="$(echo `date +"%b %d %T %:z"` `hostname`) "
539
+   return 0
540
+}
541
+
542
+################################################################################
543
+# log_success_msg()                                                            #
544
+# Usage: log_success_msg ["message"]                                           #
545
+#                                                                              #
546
+# Purpose: Print a successful status message to the screen and                 #
547
+#          a boot log file.                                                    #
548
+#                                                                              #
549
+# Inputs: $@ - Message                                                         #
550
+#                                                                              #
551
+# Return values: Not used                                                      #
552
+################################################################################
553
+log_success_msg()
554
+{
555
+    echo -n -e "${@}"
556
+    echo -e "${SET_COL}${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
557
+
558
+    timespec
559
+    echo -e "${STAMP} ${@} OK" >> ${BOOTLOG}
560
+    return 0
561
+}
562
+
563
+log_success_msg2()
564
+{
565
+    echo -n -e "${@}"
566
+    echo -e "${SET_COL}${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
567
+
568
+    echo " OK" >> ${BOOTLOG}
569
+    return 0
570
+}
571
+
572
+################################################################################
573
+# log_failure_msg()                                                            #
574
+# Usage: log_failure_msg ["message"]                                           #
575
+#                                                                              #
576
+# Purpose: Print a failure status message to the screen and                    #
577
+#          a boot log file.                                                    #
578
+#                                                                              #
579
+# Inputs: $@ - Message                                                         #
580
+#                                                                              #
581
+# Return values: Not used                                                      #
582
+################################################################################
583
+log_failure_msg()
584
+{
585
+    echo -n -e "${@}"
586
+    echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
587
+
588
+    timespec
589
+    echo -e "${STAMP} ${@} FAIL" >> ${BOOTLOG}
590
+    return 0
591
+}
592
+
593
+log_failure_msg2()
594
+{
595
+    echo -n -e "${@}"
596
+    echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
597
+
598
+    echo "FAIL" >> ${BOOTLOG}
599
+    return 0
600
+}
601
+
602
+################################################################################
603
+# log_warning_msg()                                                            #
604
+# Usage: log_warning_msg ["message"]                                           #
605
+#                                                                              #
606
+# Purpose: Print a warning status message to the screen and                    #
607
+#          a boot log file.                                                    #
608
+#                                                                              #
609
+# Return values: Not used                                                      #
610
+################################################################################
611
+log_warning_msg()
612
+{
613
+    echo -n -e "${@}"
614
+    echo -e "${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
615
+
616
+    timespec
617
+    echo -e "${STAMP} ${@} WARN" >> ${BOOTLOG}
618
+    return 0
619
+}
620
+
621
+################################################################################
622
+# log_info_msg()                                                               #
623
+# Usage: log_info_msg message                                                  #
624
+#                                                                              #
625
+# Purpose: Print an information message to the screen and                      #
626
+#          a boot log file.  Does not print a trailing newline character.      #
627
+#                                                                              #
628
+# Return values: Not used                                                      #
629
+################################################################################
630
+log_info_msg()
631
+{
632
+    echo -n -e "${@}"
633
+
634
+    timespec
635
+    echo -n -e "${STAMP} ${@}" >> ${BOOTLOG}
636
+    return 0
637
+}
638
+
639
+log_info_msg2()
640
+{
641
+    echo -n -e "${@}"
642
+
643
+    echo -n -e "${@}" >> ${BOOTLOG}
644
+    return 0
645
+}
646
+
647
+################################################################################
648
+# evaluate_retval()                                                            #
649
+# Usage: Evaluate a return value and print success or failyure as appropriate  #
650
+#                                                                              #
651
+# Purpose: Convenience function to terminate an info message                   #
652
+#                                                                              #
653
+# Return values: Not used                                                      #
654
+################################################################################
655
+evaluate_retval()
656
+{
657
+   local error_value="${?}"
658
+
659
+   if [ ${error_value} = 0 ]; then
660
+      log_success_msg2
661
+   else
662
+      log_failure_msg2
663
+   fi
664
+}
665
+
666
+################################################################################
667
+# check_signal()                                                               #
668
+# Usage: check_signal [ -{signal} | {signal} ]                                 #
669
+#                                                                              #
670
+# Purpose: Check for a valid signal.  This is not defined by any LSB draft,    #
671
+#          however, it is required to check the signals to determine if the    #
672
+#          signals chosen are invalid arguments to the other functions.        #
673
+#                                                                              #
674
+# Inputs: Accepts a single string value in the form or -{signal} or {signal}   #
675
+#                                                                              #
676
+# Return values:                                                               #
677
+#       0 - Success (signal is valid                                           #
678
+#       1 - Signal is not valid                                                #
679
+################################################################################
680
+check_signal()
681
+{
682
+    local valsig
683
+
684
+    # Add error handling for invalid signals
685
+    valsig="-ALRM -HUP -INT -KILL -PIPE -POLL -PROF -TERM -USR1 -USR2"
686
+    valsig="${valsig} -VTALRM -STKFLT -PWR -WINCH -CHLD -URG -TSTP -TTIN"
687
+    valsig="${valsig} -TTOU -STOP -CONT -ABRT -FPE -ILL -QUIT -SEGV -TRAP"
688
+    valsig="${valsig} -SYS -EMT -BUS -XCPU -XFSZ -0 -1 -2 -3 -4 -5 -6 -8 -9"
689
+    valsig="${valsig} -11 -13 -14 -15"
690
+
691
+    echo "${valsig}" | grep -- " ${1} " > /dev/null
692
+
693
+    if [ "${?}" -eq "0" ]; then
694
+        return 0
695
+    else
696
+        return 1
697
+    fi
698
+}
699
+
700
+################################################################################
701
+# check_sig_type()                                                             #
702
+# Usage: check_signal [ -{signal} | {signal} ]                                 #
703
+#                                                                              #
704
+# Purpose: Check if signal is a program termination signal or a control signal #
705
+#          This is not defined by any LSB draft, however, it is required to    #
706
+#          check the signals to determine if they are intended to end a        #
707
+#          program or simply to control it.                                    #
708
+#                                                                              #
709
+# Inputs: Accepts a single string value in the form or -{signal} or {signal}   #
710
+#                                                                              #
711
+# Return values:                                                               #
712
+#       0 - Signal is used for program termination                             #
713
+#       1 - Signal is used for program control                                 #
714
+################################################################################
715
+check_sig_type()
716
+{
717
+    local valsig
718
+
719
+    # The list of termination signals (limited to generally used items)
720
+    valsig="-ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15"
721
+
722
+    echo "${valsig}" | grep -- " ${1} " > /dev/null
723
+
724
+    if [ "${?}" -eq "0" ]; then
725
+        return 0
726
+    else
727
+        return 1
728
+    fi
729
+}
730
+
731
+################################################################################
732
+# wait_for_user()                                                              #
733
+#                                                                              #
734
+# Purpose: Wait for the user to respond if not a headless system               #
735
+#                                                                              #
736
+################################################################################
737
+wait_for_user()
738
+{
739
+   # Wait for the user by default
740
+   [ "${HEADLESS=0}" = "0" ] && read ENTER
741
+   return 0
742
+}
743
+
744
+# End /lib/lsb/init-functions
745
+
0 746
deleted file mode 100644
... ...
@@ -1,191 +0,0 @@
1
-Submitted By:            Armin K. <krejzi at email dot com>
2
-Date:                    2014-08-20
3
-Initial Package Version: 211
4
-Upstream Status:         Not applicable
5
-Origin:                  Self
6
-Description:             Make it install compat pkg-config files without
7
-                         building compat-libs which are useless on LFS.
8
-
9
-+++ b/Makefile.am	2014-08-20 19:10:25.165180155 +0200
10
-@@ -2556,7 +2556,11 @@
11
- UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
12
- 
13
- pkgconfiglib_DATA += \
14
--	src/libsystemd/libsystemd.pc
15
-+	src/libsystemd/libsystemd.pc \
16
-+	src/compat-libs/libsystemd-journal.pc \
17
-+	src/compat-libs/libsystemd-login.pc \
18
-+	src/compat-libs/libsystemd-id128.pc \
19
-+	src/compat-libs/libsystemd-daemon.pc
20
- 
21
- pkginclude_HEADERS += \
22
- 	src/systemd/sd-login.h \
23
-@@ -5551,12 +5555,6 @@
24
- 	libsystemd-id128.la \
25
- 	libsystemd-daemon.la
26
- 
27
--pkgconfiglib_DATA += \
28
--	src/compat-libs/libsystemd-journal.pc \
29
--	src/compat-libs/libsystemd-login.pc \
30
--	src/compat-libs/libsystemd-id128.pc \
31
--	src/compat-libs/libsystemd-daemon.pc
32
--
33
- # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
34
- compat-lib-install-hook:
35
- 	libname=libsystemd-login.so && $(move-to-rootlibdir)
36
-+++ b/Makefile.in	2014-08-20 19:10:25.169180216 +0200
37
-@@ -1310,21 +1310,18 @@
38
- @ENABLE_COMPAT_LIBS_TRUE@	libsystemd-id128.la \
39
- @ENABLE_COMPAT_LIBS_TRUE@	libsystemd-daemon.la
40
- 
41
--@ENABLE_COMPAT_LIBS_TRUE@am__append_294 = \
42
--@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-journal.pc \
43
--@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-login.pc \
44
--@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-id128.pc \
45
--@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-daemon.pc
46
--
47
--@ENABLE_COMPAT_LIBS_TRUE@am__append_295 = compat-lib-install-hook
48
--@ENABLE_COMPAT_LIBS_TRUE@am__append_296 = compat-lib-uninstall-hook
49
--@ENABLE_MANPAGES_TRUE@am__append_297 = \
50
-+@ENABLE_COMPAT_LIBS_TRUE@am__append_294 = compat-lib-install-hook
51
-+@ENABLE_COMPAT_LIBS_TRUE@am__append_295 = compat-lib-uninstall-hook
52
-+@ENABLE_MANPAGES_TRUE@am__append_296 = \
53
- @ENABLE_MANPAGES_TRUE@	man/custom-entities.ent
54
- 
55
--@HAVE_SYSV_COMPAT_TRUE@am__append_298 = \
56
-+@HAVE_SYSV_COMPAT_TRUE@am__append_297 = \
57
- @HAVE_SYSV_COMPAT_TRUE@	docs/sysvinit/README \
58
- @HAVE_SYSV_COMPAT_TRUE@	docs/var-log/README
59
- 
60
-+@HAVE_SYSV_COMPAT_TRUE@am__append_298 = \
61
-+@HAVE_SYSV_COMPAT_TRUE@	systemd-update-utmp-runlevel.service
62
-+
63
- @HAVE_SYSV_COMPAT_TRUE@am__append_299 = \
64
- @HAVE_SYSV_COMPAT_TRUE@	systemd-update-utmp-runlevel.service
65
- 
66
-@@ -1338,9 +1335,6 @@
67
- @HAVE_SYSV_COMPAT_TRUE@	systemd-update-utmp-runlevel.service
68
- 
69
- @HAVE_SYSV_COMPAT_TRUE@am__append_303 = \
70
--@HAVE_SYSV_COMPAT_TRUE@	systemd-update-utmp-runlevel.service
71
--
72
--@HAVE_SYSV_COMPAT_TRUE@am__append_304 = \
73
- @HAVE_SYSV_COMPAT_TRUE@	poweroff.target runlevel0.target \
74
- @HAVE_SYSV_COMPAT_TRUE@	rescue.target runlevel1.target \
75
- @HAVE_SYSV_COMPAT_TRUE@	multi-user.target runlevel2.target \
76
-@@ -1349,25 +1343,25 @@
77
- @HAVE_SYSV_COMPAT_TRUE@	graphical.target runlevel5.target \
78
- @HAVE_SYSV_COMPAT_TRUE@	reboot.target runlevel6.target
79
- 
80
--@HAVE_SYSV_COMPAT_TRUE@am__append_305 = \
81
-+@HAVE_SYSV_COMPAT_TRUE@am__append_304 = \
82
- @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel1.target.wants \
83
- @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel2.target.wants \
84
- @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel3.target.wants \
85
- @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel4.target.wants \
86
- @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel5.target.wants
87
- 
88
--@HAVE_SYSV_COMPAT_TRUE@am__append_306 = \
89
-+@HAVE_SYSV_COMPAT_TRUE@am__append_305 = \
90
- @HAVE_SYSV_COMPAT_TRUE@	--with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
91
- @HAVE_SYSV_COMPAT_TRUE@	--with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
92
- 
93
--@HAVE_SYSV_COMPAT_FALSE@am__append_307 = \
94
-+@HAVE_SYSV_COMPAT_FALSE@am__append_306 = \
95
- @HAVE_SYSV_COMPAT_FALSE@	--with-sysvinit-path= \
96
- @HAVE_SYSV_COMPAT_FALSE@	--with-sysvrcnd-path=
97
- 
98
--@HAVE_PYTHON_TRUE@am__append_308 = \
99
-+@HAVE_PYTHON_TRUE@am__append_307 = \
100
- @HAVE_PYTHON_TRUE@	--with-python
101
- 
102
--@ENABLE_GTK_DOC_TRUE@am__append_309 = \
103
-+@ENABLE_GTK_DOC_TRUE@am__append_308 = \
104
- @ENABLE_GTK_DOC_TRUE@	--enable-gtk-doc
105
- 
106
- subdir = .
107
-@@ -4901,8 +4895,8 @@
108
- 	$(am__append_266) $(am__append_289) $(nodist_systemunit_DATA) \
109
- 	$(nodist_userunit_DATA) $(pkgconfigdata_DATA) \
110
- 	$(pkgconfiglib_DATA) $(nodist_polkitpolicy_DATA) \
111
--	$(am__append_298) defined undefined
112
--DISTCLEANFILES = $(am__append_297)
113
-+	$(am__append_297) defined undefined
114
-+DISTCLEANFILES = $(am__append_296)
115
- 
116
- # Really, do not edit this file.
117
- EXTRA_DIST = shell-completion/bash/systemctl.in \
118
-@@ -5124,10 +5118,10 @@
119
- 	install-touch-usr-hook systemd-detect-virt-install-hook \
120
- 	$(am__append_95) bus-proxyd-install-hook \
121
- 	libsystemd-install-hook libudev-install-hook $(am__append_126) \
122
--	journal-install-hook $(am__append_295)
123
-+	journal-install-hook $(am__append_294)
124
- UNINSTALL_EXEC_HOOKS = $(am__append_96) bus-proxyd-uninstall-hook \
125
- 	libsystemd-uninstall-hook libudev-uninstall-hook \
126
--	journal-uninstall-hook $(am__append_296)
127
-+	journal-uninstall-hook $(am__append_295)
128
- INSTALL_DATA_HOOKS = units-install-hook hwdb-update-hook \
129
- 	catalog-update-hook
130
- UNINSTALL_DATA_HOOKS = units-uninstall-hook catalog-remove-hook
131
-@@ -5167,7 +5161,11 @@
132
- include_HEADERS = src/libudev/libudev.h
133
- noinst_DATA = $(am__append_53) $(am__append_55) $(am__append_106)
134
- pkgconfiglib_DATA = src/libsystemd/libsystemd.pc \
135
--	src/libudev/libudev.pc $(am__append_117) $(am__append_294)
136
-+	src/compat-libs/libsystemd-journal.pc \
137
-+	src/compat-libs/libsystemd-login.pc \
138
-+	src/compat-libs/libsystemd-id128.pc \
139
-+	src/compat-libs/libsystemd-daemon.pc src/libudev/libudev.pc \
140
-+	$(am__append_117)
141
- polkitpolicy_in_in_files =  \
142
- 	src/core/org.freedesktop.systemd1.policy.in.in
143
- polkitpolicy_in_files =  \
144
-@@ -5302,7 +5300,7 @@
145
- # ------------------------------------------------------------------------------
146
- INSTALL_DIRS = $(am__append_78) $(am__append_84) \
147
- 	$(sysconfdir)/udev/rules.d $(sysconfdir)/udev/hwdb.d \
148
--	$(am__append_164) $(am__append_282) $(am__append_305) \
149
-+	$(am__append_164) $(am__append_282) $(am__append_304) \
150
- 	$(prefix)/lib/modules-load.d $(sysconfdir)/modules-load.d \
151
- 	$(prefix)/lib/systemd/network $(sysconfdir)/systemd/network \
152
- 	$(prefix)/lib/sysctl.d $(sysconfdir)/sysctl.d \
153
-@@ -5313,11 +5311,11 @@
154
- 	$(pkgsysconfdir)/system/getty.target.wants \
155
- 	$(pkgsysconfdir)/user $(dbussessionservicedir) \
156
- 	$(sysconfdir)/xdg/systemd
157
--RUNLEVEL1_TARGET_WANTS = $(am__append_299)
158
--RUNLEVEL2_TARGET_WANTS = $(am__append_300)
159
--RUNLEVEL3_TARGET_WANTS = $(am__append_301)
160
--RUNLEVEL4_TARGET_WANTS = $(am__append_302)
161
--RUNLEVEL5_TARGET_WANTS = $(am__append_303)
162
-+RUNLEVEL1_TARGET_WANTS = $(am__append_298)
163
-+RUNLEVEL2_TARGET_WANTS = $(am__append_299)
164
-+RUNLEVEL3_TARGET_WANTS = $(am__append_300)
165
-+RUNLEVEL4_TARGET_WANTS = $(am__append_301)
166
-+RUNLEVEL5_TARGET_WANTS = $(am__append_302)
167
- SHUTDOWN_TARGET_WANTS = 
168
- LOCAL_FS_TARGET_WANTS = systemd-remount-fs.service tmp.mount
169
- MULTI_USER_TARGET_WANTS = $(am__append_283) getty.target \
170
-@@ -5345,7 +5343,7 @@
171
- USER_BUSNAMES_TARGET_WANTS = 
172
- SYSTEM_UNIT_ALIASES = $(am__append_195) $(am__append_208) \
173
- 	$(am__append_220) $(am__append_242) $(am__append_253) \
174
--	$(am__append_284) $(am__append_304) graphical.target \
175
-+	$(am__append_284) $(am__append_303) graphical.target \
176
- 	default.target reboot.target ctrl-alt-del.target \
177
- 	getty@.service autovt@.service
178
- USER_UNIT_ALIASES = $(systemunitdir)/shutdown.target shutdown.target \
179
-@@ -8769,8 +8767,8 @@
180
- 	--with-pamlibdir=$$dc_install_base/$(pamlibdir) \
181
- 	--with-pamconfdir=$$dc_install_base/$(pamconfdir) \
182
- 	--with-rootprefix=$$dc_install_base --disable-split-usr \
183
--	--enable-kdbus --enable-compat-libs $(am__append_306) \
184
--	$(am__append_307) $(am__append_308) $(am__append_309)
185
-+	--enable-kdbus --enable-compat-libs $(am__append_305) \
186
-+	$(am__append_306) $(am__append_307) $(am__append_308)
187
- www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
188
- OBJECT_VARIABLES := $(filter %_OBJECTS,$(.VARIABLES))
189
- ALL_OBJECTS := $(foreach v,$(OBJECT_VARIABLES),$($(v)))
190 1
deleted file mode 100644
... ...
@@ -1,45 +0,0 @@
1
-diff -ru systemd-216/src/network/networkd-manager.c systemd-216-4/src/network/networkd-manager.c
2
-+++ systemd-216-4/src/network/networkd-manager.c	2015-07-04 00:49:26.056457748 +0000
3
-@@ -35,6 +35,7 @@
4
- #include "virt.h"
5
- 
6
- #include "sd-rtnl.h"
7
-+#define UDEV_INIT_LOOP_WAIT_COUNT 10000
8
- 
9
- const char* const network_dirs[] = {
10
-         "/etc/systemd/network",
11
-@@ -225,7 +226,9 @@
12
-         NetDev *netdev = NULL;
13
-         uint16_t type;
14
-         const char *name;
15
--        int r, ifindex;
16
-+        int r, ifindex, i;
17
-+        char ifindex_str[2 + DECIMAL_STR_MAX(int)];
18
-+        struct udev_device *device = NULL;
19
- 
20
-         assert(rtnl);
21
-         assert(message);
22
-@@ -244,6 +247,21 @@
23
-         } else
24
-                 link_get(m, ifindex, &link);
25
- 
26
-+        /* Networkd must wait for udev to finish device initiatization/ renaming the interface.
27
-+        The maximum wait time is 10 second but it takes less than 1 second for udev to make it up in some udev/networkd race cases */
28
-+
29
-+        sprintf(ifindex_str, "n%d", ifindex);
30
-+        device = udev_device_new_from_device_id(m->udev, ifindex_str);
31
-+        
32
-+        for(i=0 ; i < UDEV_INIT_LOOP_WAIT_COUNT ; i++) {
33
-+                if (!udev_device_get_is_initialized(device)) {
34
-+                        usleep(1);
35
-+                        continue;
36
-+                } else {
37
-+                        break;
38
-+                }   
39
-+        } 
40
-+
41
-         r = sd_rtnl_message_read_string(message, IFLA_IFNAME, &name);
42
-         if (r < 0 || !name) {
43
-                 log_warning("rtnl: received link message without valid ifname");
44
-Only in systemd-216-4/src/network: networkd-manager.c~
45 1
new file mode 100644
... ...
@@ -0,0 +1,202 @@
0
+Submitted By:            Armin K. <krejzi at email dot com>
1
+Date:                    2015-06-28
2
+Initial Package Version: 211
3
+Upstream Status:         Not applicable
4
+Origin:                  Self
5
+Description:             Make it install compat pkg-config files without
6
+                         building compat-libs which are useless on LFS.
7
+
8
+--- a/Makefile.am	2015-06-18 18:43:06.078735861 +0200
9
+@@ -2950,7 +2950,11 @@
10
+ UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
11
+ 
12
+ pkgconfiglib_DATA += \
13
+-	src/libsystemd/libsystemd.pc
14
++	src/libsystemd/libsystemd.pc \
15
++	src/compat-libs/libsystemd-journal.pc \
16
++	src/compat-libs/libsystemd-login.pc \
17
++	src/compat-libs/libsystemd-id128.pc \
18
++	src/compat-libs/libsystemd-daemon.pc
19
+ 
20
+ pkginclude_HEADERS += \
21
+ 	src/systemd/sd-bus.h \
22
+@@ -5848,12 +5852,6 @@
23
+ 	libsystemd-id128.la \
24
+ 	libsystemd-daemon.la
25
+ 
26
+-pkgconfiglib_DATA += \
27
+-	src/compat-libs/libsystemd-journal.pc \
28
+-	src/compat-libs/libsystemd-login.pc \
29
+-	src/compat-libs/libsystemd-id128.pc \
30
+-	src/compat-libs/libsystemd-daemon.pc
31
+-
32
+ # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
33
+ compat-lib-install-hook:
34
+ 	libname=libsystemd-login.so && $(move-to-rootlibdir)
35
+--- a/Makefile.in	2015-06-19 13:03:19.779563378 +0200
36
+@@ -1246,34 +1246,28 @@
37
+ @ENABLE_COMPAT_LIBS_TRUE@	libsystemd-id128.la \
38
+ @ENABLE_COMPAT_LIBS_TRUE@	libsystemd-daemon.la
39
+ 
40
+-@ENABLE_COMPAT_LIBS_TRUE@am__append_306 = \
41
+-@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-journal.pc \
42
+-@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-login.pc \
43
+-@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-id128.pc \
44
+-@ENABLE_COMPAT_LIBS_TRUE@	src/compat-libs/libsystemd-daemon.pc
45
+-
46
+-@ENABLE_COMPAT_LIBS_TRUE@am__append_307 = compat-lib-install-hook
47
+-@ENABLE_COMPAT_LIBS_TRUE@am__append_308 = compat-lib-uninstall-hook
48
+-@ENABLE_MANPAGES_TRUE@am__append_309 = \
49
++@ENABLE_COMPAT_LIBS_TRUE@am__append_306 = compat-lib-install-hook
50
++@ENABLE_COMPAT_LIBS_TRUE@am__append_307 = compat-lib-uninstall-hook
51
++@ENABLE_MANPAGES_TRUE@am__append_308 = \
52
+ @ENABLE_MANPAGES_TRUE@	man/custom-entities.ent
53
+ 
54
+-@HAVE_SYSV_COMPAT_TRUE@am__append_310 = \
55
++@HAVE_SYSV_COMPAT_TRUE@am__append_309 = \
56
+ @HAVE_SYSV_COMPAT_TRUE@	docs/sysvinit/README \
57
+ @HAVE_SYSV_COMPAT_TRUE@	docs/var-log/README
58
+ 
59
+-@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_311 = \
60
++@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_310 = \
61
+ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@	systemd-update-utmp-runlevel.service
62
+ 
63
+-@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_312 = \
64
++@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_311 = \
65
+ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@	systemd-update-utmp-runlevel.service
66
+ 
67
+-@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_313 = \
68
++@HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@am__append_312 = \
69
+ @HAVE_SYSV_COMPAT_TRUE@@HAVE_UTMP_TRUE@	systemd-update-utmp-runlevel.service
70
+ 
71
+-@HAVE_UTMP_TRUE@am__append_314 = \
72
++@HAVE_UTMP_TRUE@am__append_313 = \
73
+ @HAVE_UTMP_TRUE@	systemd-update-utmp.service
74
+ 
75
+-@HAVE_SYSV_COMPAT_TRUE@am__append_315 = \
76
++@HAVE_SYSV_COMPAT_TRUE@am__append_314 = \
77
+ @HAVE_SYSV_COMPAT_TRUE@	poweroff.target runlevel0.target \
78
+ @HAVE_SYSV_COMPAT_TRUE@	rescue.target runlevel1.target \
79
+ @HAVE_SYSV_COMPAT_TRUE@	multi-user.target runlevel2.target \
80
+@@ -1282,28 +1276,28 @@
81
+ @HAVE_SYSV_COMPAT_TRUE@	graphical.target runlevel5.target \
82
+ @HAVE_SYSV_COMPAT_TRUE@	reboot.target runlevel6.target
83
+ 
84
+-@HAVE_SYSV_COMPAT_TRUE@am__append_316 = \
85
++@HAVE_SYSV_COMPAT_TRUE@am__append_315 = \
86
+ @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel1.target.wants \
87
+ @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel2.target.wants \
88
+ @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel3.target.wants \
89
+ @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel4.target.wants \
90
+ @HAVE_SYSV_COMPAT_TRUE@	$(systemunitdir)/runlevel5.target.wants
91
+ 
92
+-@HAVE_SYSV_COMPAT_TRUE@am__append_317 = \
93
++@HAVE_SYSV_COMPAT_TRUE@am__append_316 = \
94
+ @HAVE_SYSV_COMPAT_TRUE@	--with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
95
+ @HAVE_SYSV_COMPAT_TRUE@	--with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
96
+ 
97
+-@HAVE_SYSV_COMPAT_FALSE@am__append_318 = \
98
++@HAVE_SYSV_COMPAT_FALSE@am__append_317 = \
99
+ @HAVE_SYSV_COMPAT_FALSE@	--with-sysvinit-path= \
100
+ @HAVE_SYSV_COMPAT_FALSE@	--with-sysvrcnd-path=
101
+ 
102
+-@HAVE_PYTHON_TRUE@am__append_319 = \
103
++@HAVE_PYTHON_TRUE@am__append_318 = \
104
+ @HAVE_PYTHON_TRUE@	--with-python
105
+ 
106
+-@ENABLE_SPLIT_USR_TRUE@am__append_320 = \
107
++@ENABLE_SPLIT_USR_TRUE@am__append_319 = \
108
+ @ENABLE_SPLIT_USR_TRUE@	--enable-split-usr
109
+ 
110
+-@ENABLE_SPLIT_USR_FALSE@am__append_321 = \
111
++@ENABLE_SPLIT_USR_FALSE@am__append_320 = \
112
+ @ENABLE_SPLIT_USR_FALSE@	--disable-split-usr
113
+ 
114
+ subdir = .
115
+@@ -5098,10 +5092,10 @@
116
+ 	install-touch-usr-hook install-busnames-target-wants-hook \
117
+ 	systemd-detect-virt-install-hook dbus1-generator-install-hook \
118
+ 	$(am__append_107) libsystemd-install-hook libudev-install-hook \
119
+-	$(am__append_131) journal-install-hook $(am__append_307)
120
++	$(am__append_131) journal-install-hook $(am__append_306)
121
+ UNINSTALL_EXEC_HOOKS = dbus1-generator-uninstall-hook \
122
+ 	libsystemd-uninstall-hook libudev-uninstall-hook \
123
+-	journal-uninstall-hook $(am__append_308)
124
++	journal-uninstall-hook $(am__append_307)
125
+ INSTALL_DATA_HOOKS = units-install-hook $(am__append_122) \
126
+ 	catalog-update-hook
127
+ UNINSTALL_DATA_HOOKS = units-uninstall-hook catalog-remove-hook
128
+@@ -5139,7 +5133,10 @@
129
+ noinst_DATA = $(am__append_59) $(am__append_61)
130
+ pkgconfigdata_DATA = src/core/systemd.pc src/udev/udev.pc
131
+ pkgconfiglib_DATA = src/libsystemd/libsystemd.pc \
132
+-	src/libudev/libudev.pc $(am__append_306)
133
++	src/compat-libs/libsystemd-journal.pc \
134
++	src/compat-libs/libsystemd-login.pc \
135
++	src/compat-libs/libsystemd-id128.pc \
136
++	src/compat-libs/libsystemd-daemon.pc src/libudev/libudev.pc
137
+ polkitpolicy_in_in_files =  \
138
+ 	src/core/org.freedesktop.systemd1.policy.in.in
139
+ polkitpolicy_in_files =  \
140
+@@ -5237,7 +5234,7 @@
141
+ 	$(nodist_zshcompletion_DATA) $(am__append_60) $(am__append_62) \
142
+ 	$(gperf_txt_sources:-list.txt=-from-name.gperf) \
143
+ 	$(gperf_txt_sources) $(am__append_104) $(am__append_159) \
144
+-	$(am__append_309) $(am__append_310) defined undefined
145
++	$(am__append_308) $(am__append_309) defined undefined
146
+ AM_CPPFLAGS = \
147
+ 	-include $(top_builddir)/config.h \
148
+ 	-DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
149
+@@ -5314,7 +5311,7 @@
150
+ # ------------------------------------------------------------------------------
151
+ INSTALL_DIRS = $(am__append_85) $(am__append_89) \
152
+ 	$(sysconfdir)/udev/rules.d $(am__append_119) $(am__append_163) \
153
+-	$(am__append_294) $(am__append_316) \
154
++	$(am__append_294) $(am__append_315) \
155
+ 	$(prefix)/lib/modules-load.d $(sysconfdir)/modules-load.d \
156
+ 	$(prefix)/lib/systemd/network $(sysconfdir)/systemd/network \
157
+ 	$(prefix)/lib/sysctl.d $(sysconfdir)/sysctl.d \
158
+@@ -5329,9 +5326,9 @@
159
+ LOCAL_FS_TARGET_WANTS = systemd-remount-fs.service tmp.mount \
160
+ 	var-lib-machines.mount
161
+ MULTI_USER_TARGET_WANTS = $(am__append_295) $(am__append_302) \
162
+-	$(am__append_311) getty.target systemd-ask-password-wall.path
163
+-GRAPHICAL_TARGET_WANTS = $(am__append_312)
164
+-RESCUE_TARGET_WANTS = $(am__append_313)
165
++	$(am__append_310) getty.target systemd-ask-password-wall.path
166
++GRAPHICAL_TARGET_WANTS = $(am__append_311)
167
++RESCUE_TARGET_WANTS = $(am__append_312)
168
+ SYSINIT_TARGET_WANTS = $(am__append_68) $(am__append_75) \
169
+ 	$(am__append_77) $(am__append_82) $(am__append_88) \
170
+ 	$(am__append_92) systemd-machine-id-commit.service \
171
+@@ -5340,7 +5337,7 @@
172
+ 	systemd-journal-flush.service \
173
+ 	systemd-journal-catalog-update.service $(am__append_164) \
174
+ 	$(am__append_168) $(am__append_176) $(am__append_184) \
175
+-	$(am__append_314) systemd-update-done.service \
176
++	$(am__append_313) systemd-update-done.service \
177
+ 	dev-hugepages.mount dev-mqueue.mount sys-kernel-config.mount \
178
+ 	sys-kernel-debug.mount sys-fs-fuse-connections.mount \
179
+ 	systemd-sysctl.service systemd-ask-password-console.path
180
+@@ -5359,7 +5356,7 @@
181
+ SYSTEM_UNIT_ALIASES = $(am__append_191) $(am__append_202) \
182
+ 	$(am__append_214) $(am__append_238) $(am__append_245) \
183
+ 	$(am__append_257) $(am__append_276) $(am__append_296) \
184
+-	$(am__append_315) graphical.target default.target \
185
++	$(am__append_314) graphical.target default.target \
186
+ 	reboot.target ctrl-alt-del.target getty@.service \
187
+ 	autovt@.service
188
+ USER_UNIT_ALIASES = $(systemunitdir)/shutdown.target shutdown.target \
189
+@@ -9047,8 +9044,8 @@
190
+ 	--with-pamlibdir=$$dc_install_base/$(pamlibdir) \
191
+ 	--with-pamconfdir=$$dc_install_base/$(pamconfdir) \
192
+ 	--with-rootprefix=$$dc_install_base --enable-compat-libs \
193
+-	$(am__append_317) $(am__append_318) $(am__append_319) \
194
+-	$(am__append_320) $(am__append_321)
195
++	$(am__append_316) $(am__append_317) $(am__append_318) \
196
++	$(am__append_319) $(am__append_320)
197
+ www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
198
+ OBJECT_VARIABLES := $(filter %_OBJECTS,$(.VARIABLES))
199
+ ALL_OBJECTS := $(foreach v,$(OBJECT_VARIABLES),$($(v)))
... ...
@@ -1,30 +1,32 @@
1
-Summary:	Systemd-216
1
+Summary:	Systemd-221
2 2
 Name:		systemd
3
-Version:	216
4
-Release:	8%{?dist}
3
+Version:	221
4
+Release:	1%{?dist}
5 5
 License:	LGPLv2+ and GPLv2+ and MIT
6 6
 URL:		http://www.freedesktop.org/wiki/Software/systemd/
7 7
 Group:		System Environment/Security
8 8
 Vendor:		VMware, Inc.
9 9
 Distribution:	Photon
10
-Source0:	http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
11
-%define sha1 systemd=0d933a2f76db5d30f52429e9b172323bc6abd49a
12
-Patch0:     	systemd-216-compat-1.patch
13
-Patch1:         systemd-216-if-rename.patch
14
-Requires:	Linux-PAM
15
-Requires:	libcap
16
-Requires:	xz
17
-BuildRequires:	intltool
10
+Source0:	http://www.freedesktop.org/software/%{name}/%{name}-%{version}.tar.xz
11
+%define sha1 systemd-221=682ebb60305f4bf1067aca929d664d062e80888f
12
+Patch0:     	systemd-221-compat-1.patch
13
+Source1:	lfs-lsb-init-functions
14
+
15
+BuildRequires:	glib-devel
18 16
 BuildRequires:	gperf
19
-BuildRequires:	libcap
20
-BuildRequires:	xz-devel
21
-BuildRequires:	Linux-PAM
22
-BuildRequires:	XML-Parser
17
+BuildRequires:	intltool
23 18
 BuildRequires:	kbd
24 19
 BuildRequires:	kmod
25
-Requires:	kmod
26
-BuildRequires:	glib-devel
20
+BuildRequires:	Linux-PAM
21
+BuildRequires:	libcap
22
+BuildRequires:	XML-Parser
23
+BuildRequires:	xz-devel
27 24
 Requires:	glib
25
+Requires:	kmod
26
+Requires:	Linux-PAM
27
+Requires:	libcap
28
+Requires:	xz
29
+
28 30
 %description
29 31
 Systemd is an init replacement with better process control and security
30 32
 
... ...
@@ -39,21 +41,21 @@ cc_cv_CFLAGS__flto=no
39 39
 EOF
40 40
 sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h")
41 41
 %patch0 -p1
42
-%patch1 -p1
42
+
43 43
 %build
44
-./configure --prefix=%{_prefix}                                    \
44
+./configure --prefix=%{_prefix}                                     \
45 45
             --sysconfdir=/etc                                       \
46 46
             --localstatedir=/var                                    \
47 47
             --config-cache                                          \
48 48
             --with-rootprefix=                                      \
49
-            --with-rootlibdir=/usr/lib                                  \
49
+            --with-rootlibdir=/usr/lib                              \
50 50
             --enable-split-usr                                      \
51 51
             --disable-firstboot                                     \
52 52
             --disable-ldconfig                                      \
53 53
             --disable-sysusers                                      \
54 54
             --without-python                                        \
55 55
             --enable-pam                                            \
56
-            --docdir=%{_prefix}/share/doc/systemd-216                     \
56
+            --docdir=%{_prefix}/share/doc/systemd-221               \
57 57
             --with-dbuspolicydir=/etc/dbus-1/system.d               \
58 58
             --with-dbusinterfacedir=%{_prefix}/share/dbus-1/interfaces    \
59 59
             --with-dbussessionservicedir=%{_prefix}/share/dbus-1/services \
... ...
@@ -63,6 +65,7 @@ sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h")
63 63
 	    --with-rc-local-script-path-start=/etc/rc.d/rc.local
64 64
 
65 65
 make %{?_smp_mflags}
66
+
66 67
 %install
67 68
 [ %{buildroot} != "/"] && rm -rf %{buildroot}/*
68 69
 make DESTDIR=%{buildroot} install
... ...
@@ -72,15 +75,19 @@ for tool in runlevel reboot shutdown poweroff halt telinit; do
72 72
 done
73 73
 ln -sfv ../lib/systemd/systemd %{buildroot}/sbin/init
74 74
 rm -f %{buildroot}%{_var}/log/README
75
+install -vDm 0755 %{SOURCE1} %{buildroot}%{_libdir}/lsb/init-functions
75 76
 
76 77
 #cp %{buildroot}/usr/share/factory/etc/pam.d/system-auth %{buildroot}%{_sysconfdir}/pam.d/system-auth
77 78
 #cp %{buildroot}/usr/share/factory/etc/pam.d/other %{buildroot}%{_sysconfdir}/pam.d/other
78 79
 
79 80
 %post	-p /sbin/ldconfig
81
+
80 82
 %postun	
81 83
 /sbin/ldconfig
84
+
82 85
 %clean
83 86
 rm -rf %{buildroot}/*
87
+
84 88
 %files
85 89
 %defattr(-,root,root)
86 90
 %{_sysconfdir}/*
... ...
@@ -95,7 +102,9 @@ rm -rf %{buildroot}/*
95 95
 
96 96
 
97 97
 %changelog
98
-*	Tue Jul 20 2015 Divya Thaluru <dthaluru@vmware.com> 216-8
98
+*	Mon Aug 10 2015 Vinay Kulkarni <kulkarniv@vmware.com> 221-1
99
+-	Update systemd to v221
100
+*	Mon Jul 20 2015 Divya Thaluru <dthaluru@vmware.com> 216-8
99 101
 -	Adding sysvinit support 
100 102
 *       Mon Jul 06 2015 Kumar Kaushik <kaushikk@vmware.com> 216-7
101 103
 -       Fixing networkd/udev race condition for renaming interface.