Merge lp:~philipgwyn/ltsp/ltsp-rhel into lp:~ltsp-upstream/ltsp/ltsp-trunk

Proposed by Philip Gwyn
Status: Rejected
Rejected by: Alkis Georgopoulos
Proposed branch: lp:~philipgwyn/ltsp/ltsp-rhel
Merge into: lp:~ltsp-upstream/ltsp/ltsp-trunk
Diff against target: 128 lines (+94/-1)
4 files modified
client/Redhat/share/ltsp/init-ltsp.d/09-hostname (+2/-0)
client/Redhat/share/ltsp/init-ltsp.d/49-no-nbd-swap (+14/-0)
client/Redhat/share/ltsp/init-ltsp.d/50-rm-system-services (+67/-0)
client/initscripts/ltsp-init-common (+11/-1)
To merge this branch: bzr merge lp:~philipgwyn/ltsp/ltsp-rhel
Reviewer Review Type Date Requested Status
Alkis Georgopoulos Disapprove
Review via email: mp+239898@code.launchpad.net

Description of the change

A few small changes to get more things working on CentOS 6.

To post a comment you must log in.
Revision history for this message
Vagrant Cascadian (vagrantc) wrote :

First off, I haven't worked with Redhat based distributions for many, many years...

It seems like the IPV4ADDR/IPV4NETMASK changes should be conditional if they're not already set, and the redhat-specific changes could be merged into client/share/init-ltsp.d/09-hostname.

NBD swap is entirely independent of the type of rootfs used. It should use NBD_SWAP=false for environments that don't want to use it.

I'm wondering if it wouldn't be feasible to merge 50-rm-system-services from Debian, Gentoo and Redhat, rather than forking all the various versions...

syslog support should be enabled conditionally on the SYSLOG_HOST variable.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

I'm setting the state of old merge requests that have been stale for years, to rejected; if someone wants, he can do another merge request in git format, since now ltsp uses git.

review: Disapprove

Unmerged revisions

2610. By Philip Gwyn <email address hidden>

Set IPV4ADDR and IPV4NETMASK

2609. By Philip Gwyn <email address hidden>

Log to stderr if syslog isn't running

2608. By Philip Gwyn <email address hidden>

Added 49-no-nbd-swap
    - it will prevent checking nbd ports for swapfiles if / is mounted via NFS
    - use NBD_SWAP=true to override

2607. By Philip Gwyn <email address hidden>

Don't use function foo(), that is a bashism

2606. By Philip Gwyn <email address hidden>

Added support for upstart

2605. By Philip Gwyn <email address hidden>

Tweak comments

2604. By Philip Gwyn <email address hidden>

Added 50-rm-system-services

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/Redhat/share/ltsp/init-ltsp.d/09-hostname'
2--- client/Redhat/share/ltsp/init-ltsp.d/09-hostname 2013-02-27 08:22:30 +0000
3+++ client/Redhat/share/ltsp/init-ltsp.d/09-hostname 2014-10-28 19:13:05 +0000
4@@ -5,6 +5,8 @@
5 HOSTNAME_EXTRA=$(ip link show $DEVICE | awk '/ether/{print $2}' | tr ':' '-')
6 ;;
7 ip|"")
8+ IPV4ADDR=$(ip -4 a s $DEVICE |awk 'sub(/\/24/, ""){print $2}')
9+ IPV4NETMASK=$(ip -4 a s $DEVICE |awk 'sub(/\/24/, ""){print $4}')
10 HOSTNAME_EXTRA=$(echo "$IPV4ADDR.$IPV4NETMASK" | awk -F "." '{ print (($1%(256-$5)*256+$2%(256-$6))*256+$3%(256-$7))*256+$4%(256-$8) }')
11 ;;
12 esac
13
14=== added file 'client/Redhat/share/ltsp/init-ltsp.d/49-no-nbd-swap'
15--- client/Redhat/share/ltsp/init-ltsp.d/49-no-nbd-swap 1970-01-01 00:00:00 +0000
16+++ client/Redhat/share/ltsp/init-ltsp.d/49-no-nbd-swap 2014-10-28 19:13:05 +0000
17@@ -0,0 +1,14 @@
18+#!/bin/sh
19+
20+#
21+# We want to prevent probing for NBD swap files in 50-nbd-swap
22+# if root is mounted via NFS.
23+#
24+
25+# Only do things if NBD_SWAP is empty
26+if test -z "$NBD_SWAP" ; then
27+ # At the point this is run, /etc/fstab and /etc/mtab are empty
28+ if grep /sysroot /proc/mounts | grep -q " nfs " ; then
29+ NBD_SWAP=false
30+ fi
31+fi
32
33=== added file 'client/Redhat/share/ltsp/init-ltsp.d/50-rm-system-services'
34--- client/Redhat/share/ltsp/init-ltsp.d/50-rm-system-services 1970-01-01 00:00:00 +0000
35+++ client/Redhat/share/ltsp/init-ltsp.d/50-rm-system-services 2014-10-28 19:13:05 +0000
36@@ -0,0 +1,67 @@
37+#!/bin/sh
38+# Remove some system services that don't make sense in live sessions.
39+# The user can add more items by declaring space separated RM_SYSTEM_SERVICES
40+# or RM_THIN_SYSTEM_SERVICES lists in lts.conf. The RM_THIN_SYSTEM_SERVICES list
41+# is ignored by fat clients.
42+# KEEP_SYSTEM_SERVICES is a space separated whitelist of services.
43+
44+allowed_services() {
45+ local service description
46+
47+ echo "$@" | while read service description; do
48+ case " $KEEP_SYSTEM_SERVICES " in
49+ *" $service "*)
50+ ;;
51+ *)
52+ echo -n " $service"
53+ ;;
54+ esac
55+ done
56+}
57+
58+# $RM_SYSTEM_SERVICES are removed for all clients
59+rm_services="$RM_SYSTEM_SERVICES $(allowed_services "
60+rsyslog # rsyslog daemon
61+xdm # X.Org Display Manager
62+")"
63+
64+# $RM_THIN_SYSTEM_SERVICES are removed for thin clients
65+if ! boolean_is_true "$LTSP_FATCLIENT"; then
66+ rm_services="$rm_services $RM_THIN_SYSTEM_SERVICES $(allowed_services "
67+cups # CUPS Printing spooler and server
68+NetworkManager # Network connection manager
69+")"
70+
71+ # For low RAM thin clients, disable whatever isn't essential for booting
72+ memtotal=$(sed -n 's/MemTotal: *\([0-9]*\) .*/\1/p' /proc/meminfo)
73+ memtotal=$(($memtotal / 1024))
74+ RM_RAM_THRESHOLD=${RM_RAM_THRESHOLD:-128}
75+ if [ "$memtotal" -le "$RM_RAM_THRESHOLD" ]; then
76+ rm_services="$rm_services $RM_LOW_RAM_SERVICES $(allowed_services "
77+uptimed # Uptime Daemon
78+")"
79+ fi
80+fi
81+
82+# We don't need NFS-related services if we're not using nfs
83+if ! grep -q nfs /etc/fstab; then
84+ rm_services="$rm_services $(allowed_services "
85+portreserve
86+nfs # Network File System
87+rpcbind
88+nfslock
89+")"
90+else
91+ rm_services="$rm_services nbd"
92+fi
93+
94+for service in $rm_services; do
95+ if test -f "/etc/rc.d/init.d/$service" ; then
96+ debug "Deactivating $service"
97+ # we don't use chkconfig $sevice off because that's needlessly slow
98+ rm -f /etc/rc.d/rc?.d/S??$service
99+ elif test -f "/etc/init/$service.conf" ; then
100+ debug "Removing $service"
101+ rm -f "/etc/init/$service.conf"
102+ fi
103+done
104
105=== modified file 'client/initscripts/ltsp-init-common'
106--- client/initscripts/ltsp-init-common 2013-07-31 00:32:42 +0000
107+++ client/initscripts/ltsp-init-common 2014-10-28 19:13:05 +0000
108@@ -3,9 +3,19 @@
109 # ltsp_config sources ltsp-client-functions
110 . /usr/share/ltsp/ltsp_config
111
112+# detect if syslog is loaded
113+ltsp_have_syslog=
114+if ps | grep syslog ; then
115+ ltsp_have_syslog=true
116+fi
117+
118 warn() {
119 msg="$1"
120- logger -p user.warning -t ltsp-client "warning: $msg"
121+ if test -n "$ltsp_have_syslog" ; then
122+ logger -p user.warning -t ltsp-client "warning: $msg"
123+ else
124+ echo "[ltsp-client] warning: $msg" >&1
125+ fi
126 }
127
128 start_sound() {

Subscribers

People subscribed via source and target branches

to all changes: