Merge lp:~stumbaumr/ltsp/ltsp into lp:~ltsp-upstream/ltsp/ltsp-trunk

Proposed by Rainer Stumbaum
Status: Rejected
Rejected by: Alkis Georgopoulos
Proposed branch: lp:~stumbaumr/ltsp/ltsp
Merge into: lp:~ltsp-upstream/ltsp/ltsp-trunk
Diff against target: 106 lines (+14/-2)
6 files modified
client/init-ltsp (+3/-1)
client/share/ltsp/init-ltsp.d/50-swap (+2/-0)
client/share/ltsp/kioskSession (+2/-0)
client/share/ltsp/screen-session.d/XS90-assembleXorgConf (+2/-0)
client/share/ltsp/screen.d/kiosk (+2/-1)
client/share/ltsp/screen_session (+3/-0)
To merge this branch: bzr merge lp:~stumbaumr/ltsp/ltsp
Reviewer Review Type Date Requested Status
Alkis Georgopoulos Disapprove
Vagrant Cascadian Needs Fixing
Review via email: mp+235347@code.launchpad.net

Description of the change

Added code for bug #1314201 Logging in LTSP startup

To post a comment you must log in.
lp:~stumbaumr/ltsp/ltsp updated
2599. By Rainer Stumbaum

KIOSK_OPTIONS are passed on from the calling script, the variable itself is empty.
This is a quick fix - should be fixed properly...

Revision history for this message
Vagrant Cascadian (vagrantc) wrote :

Thanks for the patches!

The KIOSK_OPTIONS part in kioskSession is not be needed, it's handled by passing the environment variable in screen.d/kiosk to kioskSession in recent LTSP versions.

Regarding the logging, it would be better to have all the various logging functions in a function, which could include a conditional to enable/disable it. The conditional might be best as a bootprompt option, given that some of the logging happens before lts.conf is processed.

There are significant portions of the ltsp codebase which run in "set -e", and so unconditionally calling "logger" or writing to /dev/kmsg could actually result in unhandled errors, though a brief review of this particular code was not running under "set -e". Handling this in a function would also be cleaner.

review: Needs Fixing
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

2599. By Rainer Stumbaum

KIOSK_OPTIONS are passed on from the calling script, the variable itself is empty.
This is a quick fix - should be fixed properly...

2598. By Rainer Stumbaum

Removed excessive logging

2597. By Rainer Stumbaum

Added logging code:
- where syslog is available using logger
- where syslog is not yet available using /dev/kmsg

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/init-ltsp'
2--- client/init-ltsp 2012-05-19 05:04:42 +0000
3+++ client/init-ltsp 2014-09-20 00:26:57 +0000
4@@ -1,4 +1,5 @@
5 #!/bin/sh
6+echo "LTSP: $0: Starting..." > /dev/kmsg
7
8 . /usr/share/ltsp/ltsp-client-functions
9 scriptsdir="/usr/share/ltsp/init-ltsp.d"
10@@ -26,9 +27,9 @@
11 warn "Continuing init-ltsp execution"
12 fi
13 debug "Sourcing $script"
14+ echo "LTSP: $0: Sourcing $script" > /dev/kmsg
15 . "$script"
16 done
17-
18 debug "Done"
19
20 # init=/sbin/init-ltsp can be used to launch this script, which should then
21@@ -36,5 +37,6 @@
22 # To run it from the initramfs instead, set the EXEC_INIT environment variable
23 # to "false".
24 if [ "$EXEC_INIT" != "false" ]; then
25+ echo "LTSP: $0: Starting /sbin/init" > /dev/kmsg
26 exec /sbin/init
27 fi
28
29=== modified file 'client/share/ltsp/init-ltsp.d/50-swap'
30--- client/share/ltsp/init-ltsp.d/50-swap 2013-12-10 08:24:49 +0000
31+++ client/share/ltsp/init-ltsp.d/50-swap 2014-09-20 00:26:57 +0000
32@@ -3,6 +3,7 @@
33 for part in `sfdisk -l 2>/dev/null | awk '/ 82 / { print $1}'`; do
34 swap_devices="$swap_devices $part"
35 done
36+ echo "LTSP: $0: Found local swap partition $part" > /dev/kmsg
37 fi
38
39 # Set NBD_SWAP=true by default for clients with RAM < NBD_SWAP_THRESHOLD
40@@ -55,5 +56,6 @@
41 fi
42 mkswap $swap
43 fi
44+ echo "LTSP: $0: Adding swap device $swap" > /dev/kmsg
45 swapon $swap
46 done
47
48=== modified file 'client/share/ltsp/kioskSession'
49--- client/share/ltsp/kioskSession 2012-06-08 23:59:36 +0000
50+++ client/share/ltsp/kioskSession 2014-09-20 00:26:57 +0000
51@@ -1,6 +1,8 @@
52 #!/bin/sh
53
54 KIOSK_EXE=$1
55+shift
56+KIOSK_OPTIONS="$*"
57 KIOSKHOME=/usr/local/share/ltspkiosk/home
58 KIOSKSTARTUP=/usr/local/share/ltspkiosk/startup
59
60
61=== modified file 'client/share/ltsp/screen-session.d/XS90-assembleXorgConf'
62--- client/share/ltsp/screen-session.d/XS90-assembleXorgConf 2008-12-31 21:21:50 +0000
63+++ client/share/ltsp/screen-session.d/XS90-assembleXorgConf 2014-09-20 00:26:57 +0000
64@@ -6,9 +6,11 @@
65 if boolean_is_true "${CONFIGURE_X}"; then
66 # Run custom command if supplied, otherwise use ours
67 if [ -n "${CONFIGURE_X_COMMAND}" ] && [ -x "${CONFIGURE_X_COMMAND}" ]; then
68+ logger -i -p syslog.info -t LTSP "$0: Running ${CONFIGURE_X_COMMAND}"
69 ${CONFIGURE_X_COMMAND}
70 else
71 if [ -n "$screen_hacks" ] || [ -n "$monitor_hacks" ] || [ -n "$device_hacks" ] || [ -n "$module_hacks" ] || [ -n "$display_hacks" ]; then
72+ logger -i -p syslog.info -t LTSP "$0: Writing ${XCONF} ( using $screen_hacks $monitor_hacks $device_hacks $module_hacks $display_hacks)"
73 write_xorg_conf > ${XCONF} || true
74 fi
75 fi
76
77=== modified file 'client/share/ltsp/screen.d/kiosk'
78--- client/share/ltsp/screen.d/kiosk 2014-09-11 03:36:03 +0000
79+++ client/share/ltsp/screen.d/kiosk 2014-09-20 00:26:57 +0000
80@@ -49,6 +49,7 @@
81 # Edit passwd homedir entry for programs that look it up from there
82 sed -i -e '\|'${KIOSKUSER}'|s|[^:]*\(:[^:]*\)$|'$TMPDIR'\1|' /etc/passwd
83
84-su - ${KIOSKUSER} -c "XINITRC_DAEMON=${XINITRC_DAEMON} KIOSK_WM=${KIOSK_WM} KIOSK_OPTIONS=${KIOSK_OPTIONS} xinit $xinitrc /usr/share/ltsp/kioskSession ${KIOSK_EXE} -- ${DISPLAY} vt${TTY} -nolisten tcp ${X_ARGS} -br" >/dev/null
85+logger -i -p syslog.info -t LTSP "$0: Running su - ${KIOSKUSER} -c \"XINITRC_DAEMON=${XINITRC_DAEMON} KIOSK_WM=${KIOSK_WM} KIOSK_OPTIONS=${KIOSK_OPTIONS} xinit $xinitrc /usr/share/ltsp/kioskSession ${KIOSK_EXE} -- ${DISPLAY} vt${TTY} -nolisten tcp ${X_ARGS} -br\""
86+su - ${KIOSKUSER} -c "XINITRC_DAEMON=${XINITRC_DAEMON} KIOSK_WM=${KIOSK_WM} KIOSK_OPTIONS=${KIOSK_OPTIONS} xinit $xinitrc /usr/share/ltsp/kioskSession ${KIOSK_EXE} -- ${DISPLAY} vt${TTY} -nolisten tcp ${X_ARGS} -br" 2>&1 | logger -i -p syslog.info -t LTSP
87
88 rm -rf ${TMPDIR}
89
90=== modified file 'client/share/ltsp/screen_session'
91--- client/share/ltsp/screen_session 2013-01-08 18:33:21 +0000
92+++ client/share/ltsp/screen_session 2014-09-20 00:26:57 +0000
93@@ -73,10 +73,13 @@
94 fi
95
96 for script in $(run_parts_list /usr/share/ltsp/screen-session.d/ S); do
97+ logger -i -p syslog.info -t LTSP "$0: Sourcing $script"
98 . "$script"
99 done
100+ logger -i -p syslog.info -t LTSP "$0: Running $script_path $args"
101 "$script_path" "$args"
102 for script in $(run_parts_list /usr/share/ltsp/screen-session.d/ K); do
103+ logger -i -p syslog.info -t LTSP "$0: Sourcing $script"
104 . "$script"
105 done
106 done

Subscribers

People subscribed via source and target branches