SYSLOG option in lts.conf not documented

Bug #697387 reported by Imre Gergely
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP5
Fix Released
Low
Unassigned
ltsp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I was looking for a way to _disable_ remote logging on the thin clients. There's an ltsp.conf file generated on the client at boot, which sends logs to $SERVER by default:

root@ltsp1:~# cat /etc/rsyslog.d/ltsp.conf
*.* @192.168.0.254

There is code to disable this in /opt/ltsp/i386/usr/share/ltsp/ltsp-init-common around line 300:

configure_syslog() {
    if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then
        syslog_conf=/etc/syslog.conf
        if [ -d /etc/rsyslog.d ]; then
            syslog_conf=/etc/rsyslog.d/ltsp.conf
            touch $syslog_conf
        fi
        if [ -f "$syslog_conf" ]; then
            cat <<EOF > "$syslog_conf"
*.* @${SYSLOG_HOST:-$SERVER}
EOF
        fi
    fi
}

This SYSLOG option does not appear in the documentation (man 5 lts.conf). It should be added if it's not a hack (and I don't see why it would be).

Changed in ltsp (Ubuntu):
status: New → Triaged
Changed in ltsp:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Wim Muskee (wimmuskee) wrote :

Current behaviour of configure_syslog() seems a little weird, shouldn't it just be SYSLOG=true or false ? Or replace SYSLOG by SYSLOG_REMOTE=true or false, to make the option clearer?

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

Maybe the following line could be changed in the code:

- if [ -z "$SYSLOG" ] || [ "$SYSLOG" = "remote" ]; then
+ if [ "${SYSLOG_HOST-localhost}" != "localhost" ]; then

The weird ${SYSLOG_HOST-localhost} syntax means "if SYSLOG_HOST is set, but empty, then return the string localhost".
So to disable remote logging, one of the following could be used in lts.conf:

SYSLOG_HOST=""
or
SYSLOG_HOST="localhost"

Then there wouldn't be any need to introduce a new variable named "SYSLOG".

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

Another problem is that the default configuration file name is defined in the configure_syslog() function as:
syslog_conf=/etc/rsyslog.d/ltsp.conf

That, in Ubuntu, doesn't override the defaults in /etc/rsyslog.d/50-default.conf, so by default LTSP clients log locally, not on the server, contrary to what the man page says about SYSLOG_HOST.

So a second change is needed:
- syslog_conf=/etc/rsyslog.d/ltsp.conf
+ syslog_conf=/etc/rsyslog.d/90-ltsp.conf

Revision history for this message
Xavier Brochard (xavier) wrote :

To complete Alkis point: as one need to setup also the server rsyslog.conf, I don't see why default SYSLOG is true.

Revision history for this message
Wim Muskee (wimmuskee) wrote :

Agreed with alkisg.

Changed in ltsp (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Wim Muskee (wimmuskee) wrote :

Committed: Defaulted local syslog, define SYSLOG_HOST in lts.conf for remote logging.

Changed in ltsp:
status: Triaged → Fix Committed
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in LTSP 5.4.1.

Changed in ltsp:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (7.2 KiB)

This bug was fixed in the package ltsp - 5.4.2-2ubuntu1

---------------
ltsp (5.4.2-2ubuntu1) quantal; urgency=low

  * Merging from Debian. Remaining changes:
    - Include dhcpd.conf configuration using 192.168.0.1/24 instead of upstream
      192.168.67.0/24 (until we deal with upgrades properly)
    - X-Ubuntu-Depends entries to keep similar package list as pre-merge
    - Change debian/watch to monitor Debian instead of Ubuntu
    - Include ltsp-cluster in ltsp-client-core
    - Include ltsp-open in ltsp-client-core
    - Set ltsp-client-builder/ltsp_update_image to true by default
    - Set ltsp-client-builder/configure_network_interface to true by default
    - Add ltsp-client-builder/fat-client
    - Setup Edubuntu LTSP in ltsp-server.postinst

ltsp (5.4.2-2) unstable; urgency=low

  * ltsp-server: Move lts.conf from doc to doc/examples.

ltsp (5.4.2-1) unstable; urgency=low

  * New upstream version:
    - init-ltsp.d: regenerate dbus machine-id.
    - Allow regular printer sharing via CUPS.
    - Split common-server.conf to ltsp-server.conf and ltsp-client.conf.

  * Install update-kernels.conf from debian/rules to handle differences in
    Ubuntu and Debian.

ltsp (5.4.1-1) unstable; urgency=low

  * New upstream version:
    - Rewrite kiosk screen script and corresponding plugin handling to create
      ltspkiosk user and dirs at runtime.
    - Only use X_SMART_COLOR_DEPTH if X_COLOR_DEPTH is unset.
    - When DNS_SERVER is unset, try to locate one.
    - Default local syslog, define SYSLOG_HOST in lts.conf for remote logging.
      (LP: #697387)
    - Improvements to update-kernels:
      + Default to a versioned kernel boot entry rather than a symlinked one.
      + Create a sub-menu for all available kernel versions and variants.
      + Option to use syslinux ifcpu64.c32 to select an appropriate 64-bit, PAE
        or 32-bit kernel at boot.
      + Generate boot menu entries for both NFS and NBD.
      + Add yaboot entries for all kernel versions and boot methods.
    - ltsp-common-functions: Implement /etc/ltsp/*.conf.d include dirs.
    - ltsp-update-sshkeys: Do not fail if /etc/ssh/ssh_host_*_key.pub
      doesn't exist.
    - ltsp-server-dnsmasq.conf example: increase DHCP lease to 8h.
    - Fix TIMESERVER support in init-ltsp.d hook.
    - Ensure $HOME is set in xfreerdp screen script, working around an
      xfreerdp segfault.

  * ltsp-client-core: Install a default update-kernels.conf.
  * Implement substvars mechanism to account for differences in Debian and
    Ubuntu packaging.
  * Add Build-Depends on dctrl-tools.
  * ltsp-server: Only add nfs-kernel-server to Recommends on Debian.
  * ltsp-server-standalone:
    - Only add nfs-kernel-server to Depends on Debian.
    - Add ltsp-docs to Recommends.
  * Run some "make clean" calls in a dh_autoreconf_clean override, otherwise
    dh_autoreconf_clean may remove files necessary for the generated Makefiles.
  * ltsp-client-builder: Add debhelper token to postinst.

ltsp (5.4.0-1) unstable; urgency=low

  * New upstream version:
    - Rewrite ltsp-update-image:
      + Test that ionice works before using it (needed for some openvz
        containers).

    - ltsp-config:...

Read more...

Changed in ltsp (Ubuntu):
status: Invalid → Fix Released
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

A quick how-to for those seeking to enable remote logging for ltsp clients in Ubuntu.

1) Uncomment the following lines in /etc/rsyslog.conf:
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

2) Restart rsyslog:
sudo service rsyslog restart

3) Set the following line in lts.conf:
SYSLOG_HOST=server

4) Restart clients, you can now see their output in the server, with e.g.
tail -f /var/log/syslog

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

Updated how-to for the new rsyslog format and logging to a separate file:

1) Create /etc/rsyslog.d/20-ltsp.conf with the following contents:
ruleset(name="remote") {
    action(type="omfile" file="/var/log/ltsp-clients.log")
}

# bind ruleset to tcp listener and activate it:
module(load="imudp")
input(type="imudp" port="514" ruleset="remote")

2) Restart rsyslog:
sudo service rsyslog restart

3) Set the following line in lts.conf:
SYSLOG_HOST=server

4) Restart clients, you can now see their output in the server, with e.g.
tail -f /var/log/ltsp-clients.log

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.