Re: [systemd-devel] Unit file for motd (message of the day)

2012-06-19 Thread Paul Menzel
Am Dienstag, den 19.06.2012, 20:04 +0200 schrieb Lennart Poettering:
 On Sun, 10.06.12 14:40, Paul Menzel (paulepan...@users.sourceforge.net) wrote:

Dear Lennart,

[ Roger Leigh ]
* initscripts:
  - Don't generate or touch /etc/motd.  Instead, the dynamic part 
  of
/etc/motd is created as /run/motd.dynamic, leaving /etc/motd
entirely under the control of the system administrator.  If
/etc/motd is a symlink to /run/motd, /etc/motd.tail is moved
back to /etc/motd.  Closes: #353229, #624391, #668307.  
  /etc/motd
is not removed if initscripts is purged, since it's not owned 
  by
initscripts.
  - By default, /run/motd is just the output of uname, preserving 
  the
existing behaviour.  However, should the administrator wish to
include dynamic information in the motd, they may write 
  scripts
to update /run/motd.dynamic as they please.  Closes: #437176.
 
 Yikes, baroque.
 
  So is systemd’s conversion of that init.d script to a unit file take so
  long? Can someone point me to a unit/service file for motd so that I can
  compare it? Unfortunately I could not find one on the net when searching
  for »fedora systemd motd service file«.
 
 Honestly I always found that this mangling of motd in Debian is
 quite confused. /etc should be considered read-only. Always writing
 to the root fs just because you boot the machine is a really bad idea.

Reading this changelog entry and the init.d script, I could not find
anything that is written dynamically to `/etc` and just to `/run`.

$ ls -al /etc/motd*
lrwxrwxrwx 1 root root  13 Apr  3  2008 /etc/motd - /var/run/motd
-rw-r--r-- 1 root root 286 Apr  3  2008 /etc/motd.tail
$ more /etc/motd*
::
/etc/motd
::
Linux debian-sid 3.2.0-2-686-pae #1 SMP Mon Jun 11 18:27:04 UTC 2012 
i686

The programs included with the Debian GNU/Linux system are free 
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
::
/etc/motd.tail
::

The programs included with the Debian GNU/Linux system are free 
software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

[…]


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unit file for motd (message of the day)

2012-06-19 Thread Lennart Poettering
On Tue, 19.06.12 22:14, Paul Menzel (paulepan...@users.sourceforge.net) wrote:
 Reading this changelog entry and the init.d script, I could not find
 anything that is written dynamically to `/etc` and just to `/run`.

Hmm, yeah, I think a symlink for this is really a hack, this really
should be added to pam_motd instead of playing redirection games...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unit file for motd (message of the day) (was: Trying systemd with Debian Sid/unstable on ASRock E350M1 with Crucial m4 SSD)

2012-06-10 Thread Paul Menzel
Dear systemd folks,


Am Dienstag, den 22.05.2012, 11:06 +0200 schrieb Paul Menzel:

[…]

 4. All units take less than a second to start.
 
 $ systemd-analyze blame
948ms avahi-daemon.service
729ms postfix.service
656ms rsyslog.service
632ms systemd-logind.service
559ms console-kit-log-system-start.service
523ms bootlogs.service

[…]

in Debian the init.d script bootlogs was split up and a separate init.d
script `motd` was created [1].

sysvinit (2.88dsf-24) experimental; urgency=low

  [ Roger Leigh ]
  * initscripts:
- Don't generate or touch /etc/motd.  Instead, the dynamic part of
  /etc/motd is created as /run/motd.dynamic, leaving /etc/motd
  entirely under the control of the system administrator.  If
  /etc/motd is a symlink to /run/motd, /etc/motd.tail is moved
  back to /etc/motd.  Closes: #353229, #624391, #668307.  /etc/motd
  is not removed if initscripts is purged, since it's not owned by
  initscripts.
- By default, /run/motd is just the output of uname, preserving the
  existing behaviour.  However, should the administrator wish to
  include dynamic information in the motd, they may write scripts
  to update /run/motd.dynamic as they please.  Closes: #437176.
- motd generation is split from bootlogs into a separate motd
  init script.
- bootlogs init script has been removed; current logging daemons
  handle this themselves, making this script redundant.
- tmpfs mounts are never cleaned by bootclean.sh.  Cleaning /run
  can lead to nonfunctional input when Xorg starts.  Closes: 
#669949.
  * sysvinit-utils:
- Suggest rather than Recommend bootlogd.

`systemd-analyze blame` shows that the init.d script `motd` still takes
quite a lot of time.

   363ms motd.service

There is not much going on in that script.

#!/bin/sh
### BEGIN INIT INFO
# Provides:  motd
# Required-Start:hostname $local_fs
# Required-Stop:
# Should-Start:
# Default-Start: 1 2 3 4 5
# Default-Stop:
# Short-Description: Create dynamic part of /etc/motd
# Description:   /etc/motd is user-editable and static.  This script
#creates the initial dynamic part, by default the
#output of uname, and stores it in 
/var/run/motd.dynamic.
#Both parts are output by pam_motd.
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh

do_start () {
# Update motd
uname -snrvm  /var/run/motd.dynamic
}

do_status () {
if [ -f /var/run/motd.dynamic ] ; then
return 0
else
return 4
fi
}

case $1 in
  start|)
do_start
;;
  restart|reload|force-reload)
echo Error: argument '$1' not supported 2
exit 3
;;
  stop)
# No-op
;;
  status)
do_status
exit $?
;;
  *)
echo Usage: bootlogs [start|stop|status] 2
exit 3
;;
esac

:

So is systemd’s conversion of that init.d script to a unit file take so
long? Can someone point me to a unit/service file for motd so that I can
compare it? Unfortunately I could not find one on the net when searching
for »fedora systemd motd service file«.

[…]


Thanks,

Paul


[1] 
http://packages.debian.org/changelogs/pool/main/s/sysvinit/sysvinit_2.88dsf-27/changelog#version2.88dsf-24
[2] http://wiki.gentoo.org/wiki/Systemd


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Unit file for motd (message of the day) (was: Trying systemd with Debian Sid/unstable on ASRock E350M1 with Crucial m4 SSD)

2012-06-10 Thread Kay Sievers
On Sun, Jun 10, 2012 at 2:40 PM, Paul Menzel
paulepan...@users.sourceforge.net wrote:
 Dear systemd folks,


 Am Dienstag, den 22.05.2012, 11:06 +0200 schrieb Paul Menzel:

 […]

 4. All units take less than a second to start.

         $ systemd-analyze blame
            948ms avahi-daemon.service
            729ms postfix.service
            656ms rsyslog.service
            632ms systemd-logind.service
            559ms console-kit-log-system-start.service
            523ms bootlogs.service

 […]

 in Debian the init.d script bootlogs was split up and a separate init.d
 script `motd` was created [1].

        sysvinit (2.88dsf-24) experimental; urgency=low

          [ Roger Leigh ]
          * initscripts:
            - Don't generate or touch /etc/motd.  Instead, the dynamic part of
              /etc/motd is created as /run/motd.dynamic, leaving /etc/motd
              entirely under the control of the system administrator.  If
              /etc/motd is a symlink to /run/motd, /etc/motd.tail is moved
              back to /etc/motd.  Closes: #353229, #624391, #668307.  /etc/motd
              is not removed if initscripts is purged, since it's not owned by
              initscripts.
            - By default, /run/motd is just the output of uname, preserving the
              existing behaviour.  However, should the administrator wish to
              include dynamic information in the motd, they may write scripts
              to update /run/motd.dynamic as they please.  Closes: #437176.
            - motd generation is split from bootlogs into a separate motd
              init script.
            - bootlogs init script has been removed; current logging daemons
              handle this themselves, making this script redundant.
            - tmpfs mounts are never cleaned by bootclean.sh.  Cleaning /run
              can lead to nonfunctional input when Xorg starts.  Closes: 
 #669949.
          * sysvinit-utils:
            - Suggest rather than Recommend bootlogd.

 `systemd-analyze blame` shows that the init.d script `motd` still takes
 quite a lot of time.

   363ms motd.service

 There is not much going on in that script.

        #!/bin/sh
        ### BEGIN INIT INFO
        # Provides:          motd
        # Required-Start:    hostname $local_fs
        # Required-Stop:
        # Should-Start:
        # Default-Start:     1 2 3 4 5
        # Default-Stop:
        # Short-Description: Create dynamic part of /etc/motd
        # Description:       /etc/motd is user-editable and static.  This 
 script
        #                    creates the initial dynamic part, by default the
        #                    output of uname, and stores it in 
 /var/run/motd.dynamic.
        #                    Both parts are output by pam_motd.
        ### END INIT INFO

        PATH=/sbin:/usr/sbin:/bin:/usr/bin
        . /lib/init/vars.sh

        do_start () {
                # Update motd
                uname -snrvm  /var/run/motd.dynamic
        }

        do_status () {
                if [ -f /var/run/motd.dynamic ] ; then
                        return 0
                else
                        return 4
                fi
        }

        case $1 in
          start|)
                do_start
                ;;
          restart|reload|force-reload)
                echo Error: argument '$1' not supported 2
                exit 3
                ;;
          stop)
                # No-op
                ;;
          status)
                do_status
                exit $?
                ;;
          *)
                echo Usage: bootlogs [start|stop|status] 2
                exit 3
                ;;
        esac

        :

 So is systemd’s conversion of that init.d script to a unit file take so
 long? Can someone point me to a unit/service file for motd so that I can
 compare it? Unfortunately I could not find one on the net when searching
 for »fedora systemd motd service file«.

In Fedora motd is just plain left to login(1), or pam_motd if people want that.

Making motd a service, a systemd entity of any kind, or init script is
unlikely a common interest. :)

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel