Re: Native upstart scripts – implemented
On Sun, May 09, 2010 at 02:52:57AM +0300, Elan Ruusamäe wrote: also, configtest before reload/restart action would be really important to have in upstart as well, considering that we restart services on rpm upgrades. Done. Not for 'initctl reload' (which is only 'kill -HUP'), but for 'service $name {restart|reload|try-restart|force-reload}'. Works when the init script has 'configtest' action and 'upstart_controlled --except configtest' Greets, Jacek ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sun, May 09, 2010 at 02:52:57AM +0300, Elan Ruusamäe wrote: i'd rather avoid completely the new subpackage here, if needed move the /etc/init dir to filesystem package to avoid dirdeps pulling upstart, and use conflicts tag for the current requires tag. Patrys asked for subpackages and it makes sense - the easiest to choose between upstart-way and the-old-way per package. syslog-ng/syslog-ng.init: ... upstart_controlled --except configtest i don't really understand how flush-logs is handled, It is not. 'service syslog-ng flush-logs' will tell you that. On the other hand - with upstart 'reload' does the same. Of course, flush-logs can be implemented in the init script. I guess it should if it is used by anything else (logrotate?) also how do you specify multiple excludes remains unclear. When '--except' is used, then all what follows are the excludes. also, configtest before reload/restart action would be really important to have in upstart as well, considering that we restart services on rpm upgrades. does upstart have such concept after all as restart/reload in scripts? No. 'reload' in upstart is 'kill -HUP', anything else must be re-implemented in the init script. Restart is 'stop; start'. Hmmm... Now I can see 'restart with configtest' may be easily implemented. Whenever '--except configtest' is used, 'upstart_controlled' can call configtest before trying restart. configtest on start makes little sense with upstart IMHO. ps: would be nice to know where's source of documentation, for example i did not find myself description of job file directives. From the rc-scripts init.txt: The syntax of the ``/etc/init/*.conf`` files is described in the init(5) man page. And yes, looking for a current Upstart documentation in the web gives no good results. Greets, Jacek ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sunday 09 May 2010 09:57:57 Jacek Konieczny wrote: On Sun, May 09, 2010 at 02:52:57AM +0300, Elan Ruusamäe wrote: i'd rather avoid completely the new subpackage here, if needed move the /etc/init dir to filesystem package to avoid dirdeps pulling upstart, and use conflicts tag for the current requires tag. Patrys asked for subpackages and it makes sense - the easiest to choose between upstart-way and the-old-way per package. that maybe useful for developer, but not for end user who wants to boot fastest way using upstart, as he does not know which upstart packages he must install, i.e must inspect every package one by one, seeing if he has the same base package installed on system or not. -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Friday 07 May 2010 16:33:21 Jacek Konieczny wrote: Hello, Your volunteer has done his job :) seems there's some deadlock with initctl emiting also seems the nice service name is lost there (see sshd part). also seems there's no our typical restart service after package upgrade, if you've upgrading upstart-enabled service. %define upstart_post() \ if [ -f /var/lock/subsys/%1 ] ; then \ /sbin/service --no-upstart %1 stop \ /sbin/service %1 start \ fi anyway, ps of stall: root 25974 0.4 0.5 15596 6064 pts/3S+ 11:23 0:00 \_ poldek -u upstart --up --sn carme openssh-server-upstart syslog-ng-upstart root 27078 0.4 0.5 12516 5804 pts/3S+ 11:24 0:00 \_ rpm --upgrade -vh --root / /var/cache/poldek/http_carme.pld-linux.org..glen.th.i686/syslog-ng-3.0.5-2.1.i root 27181 0.0 0.0 1872 584 pts/3S+ 11:24 0:00 \_ /bin/sh /home/users/glen/tmp/rpm-tmp.59975 2 root 27184 0.0 0.0 1872 604 pts/3S+ 11:24 0:00 \_ /bin/sh /sbin/service syslog-ng restart root 27187 0.0 0.0 2000 808 pts/3S+ 11:24 0:00 \_ /bin/sh /etc/rc.d/init.d/syslog-ng restart root 27321 0.0 0.0 5716 972 pts/3S+ 11:24 0:00 \_ /sbin/initctl emit started JOB=syslog-ng SERVICE=syslog and terminal output: 11:23:03 root[load: 5.81; cpu: 6...@ravenous ~# poldek -u upstart --up --sn carme openssh-server-upstart syslog-ng-upstart ... Preparing...### [100%] 1:rc-scripts ### [ 25%] 2:openssh### [ 50%] 3:openssh-server ### [ 75%] * Reloading OpenSSH service...[ DONE ] 4:openssh-server-upstart ### [100%] * Stopping OpenSSH service[ DONE ] * Starting sshd service...[ DONE ] Installing set #2 Processing dependencies... syslog-ng-upstart-3.0.5-2.1.i686 marks syslog-ng-3.0.5-2.1.i686 (cap syslog-ng = 3.0.5-2.1) syslog-ng-3.0.5-1.i686 obsoleted by syslog-ng-3.0.5-2.1.i686 There are 2 packages to install (1 marked by dependencies), 1 to remove: I syslog-ng-upstart-3.0.5-2.1.i686 D syslog-ng-3.0.5-2.1.i686 R syslog-ng-3.0.5-1.i686 This operation will use 423.0B of disk space. Need to get 2.7MB of archives (2.7MB to download). Retrieving carme::syslog-ng-3.0.5-2.1.i686.rpm... .. 100.0% [2.7M (450.6K/s)] Retrieving carme::syslog-ng-upstart-3.0.5-2.1.i686.rpm... .. 100.0% [4.2K (4.2K/s)] Executing rpm --upgrade -vh --root /... error: failed to stat /mnt/docs: Host is down Preparing...### [100%] 1:syslog-ng ### [ 50%] * Stopping syslog-ng service..[ DONE ] * Starting syslog-ng service..[ DONE ] # strace -p 27321 Process 27321 attached - interrupt to quit restart_syscall(... resuming interrupted call ... # lsof -p 27321 lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/users/glen/.gvfs Output information may be incomplete. lsof: WARNING: can't stat() cifs file system /mnt/docs Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME initctl 27321 root cwdDIR 254,0 4096 128 / initctl 27321 root rtdDIR 254,0 4096 128 / initctl 27321 root txtREG 254,0121084 50978235 /sbin/initctl initctl 27321 root memREG 254,0 109740720 142782 /usr/lib/locale/locale-archive initctl 27321 root memREG 254,0117047 34830808 /lib/libpthread-2.11.1.so initctl 27321 root memREG 254,0 26512 35528163 /lib/librt-2.11.1.so initctl 27321 root memREG 254,0 1339736 33654733 /lib/libc-2.11.1.so initctl 27321 root memREG 254,0214980 34344577 /lib/libdbus-1.so.3.4.0 initctl 27321 root memREG 254,0 33996 33600976 /lib/libnih-dbus.so.1.0.0 initctl 27321 root memREG 254,0 83156 33632425 /lib/libnih.so.1.0.0 initctl 27321 root memREG 254,0132403 33596389 /lib/ld-2.11.1.so initctl 27321 root0r FIFO0,8 0t0 1228197 pipe initctl 27321 root1u CHR 136,7 0t0 10 /dev/pts/7 initctl 27321 root2u CHR 136,7 0t0 10 /dev/pts/7 initctl 27321 root3u unix 0xdb670a00 0t0 1228587 socket -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org
Re: Native upstart scripts – implemented
On Sun, May 09, 2010 at 11:39:14AM +0300, Elan Ruusamäe wrote: On Friday 07 May 2010 16:33:21 Jacek Konieczny wrote: Hello, Your volunteer has done his job :) seems there's some deadlock with initctl emiting Isn't that another result of https://bugs.launchpad.net/upstart/+bug/406397 also seems the nice service name is lost there (see sshd part). How is that supposed to work and where is that 'sshd part'? also seems there's no our typical restart service after package upgrade, if you've upgrading upstart-enabled service. %define upstart_post() \ if [ -f /var/lock/subsys/%1 ] ; then \ /sbin/service --no-upstart %1 stop \ /sbin/service %1 start \ fi The service will be restarted after main package upgrade. Though we have the real problem of -upstart subpackage here: the restart should probably be done when both main and -upstart packages are upgraded. anyway, ps of stall: root 25974 0.4 0.5 15596 6064 pts/3S+ 11:23 0:00 \_ poldek -u upstart --up --sn carme openssh-server-upstart syslog-ng-upstart root 27078 0.4 0.5 12516 5804 pts/3S+ 11:24 0:00 \_ rpm --upgrade -vh --root / /var/cache/poldek/http_carme.pld-linux.org..glen.th.i686/syslog-ng-3.0.5-2.1.i root 27181 0.0 0.0 1872 584 pts/3S+ 11:24 0:00 \_ /bin/sh /home/users/glen/tmp/rpm-tmp.59975 2 root 27184 0.0 0.0 1872 604 pts/3S+ 11:24 0:00 \_ /bin/sh /sbin/service syslog-ng restart root 27187 0.0 0.0 2000 808 pts/3S+ 11:24 0:00 \_ /bin/sh /etc/rc.d/init.d/syslog-ng restart root 27321 0.0 0.0 5716 972 pts/3S+ 11:24 0:00 \_ /sbin/initctl emit started JOB=syslog-ng SERVICE=syslog I guess --no-wait for emit should be used here. Though there is something blocking – emit waits for some action on the 'started' event to finish and some service starting on this even has probably locked up (most probably due to https://bugs.launchpad.net/upstart/+bug/406397 and broken /etc/init/*.conf file (I have recently fixed those for openssh and syslog-ng)). Greets, Jacek ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sunday 09 May 2010 12:00:57 Jacek Konieczny wrote: also seems the nice service name is lost there (see sshd part). How is that supposed to work and where is that 'sshd part'? line 1 and 3 - the nice name, line 4 plain service name 1: * Reloading OpenSSH service...[ DONE ] 2: 4:openssh-server-upstart ### [100%] 3: * Stopping OpenSSH service[ DONE ] 4: * Starting sshd service...[ DONE ] the nice names are embedded in initscript as msg_* and in .spec file as extra arg for %service restart -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sunday 09 May 2010 12:00:57 Jacek Konieczny wrote: I guess --no-wait for emit should be used here. Though there is something blocking – emit waits for some action on the 'started' event to finish and some service starting on this even has probably locked up (most probably due to https://bugs.launchpad.net/upstart/+bug/406397 and broken /etc/init/*.conf file (I have recently fixed those for openssh and syslog-ng)). if thats any useful info, then initctl list: # initctl list mountall-net stop/waiting rc stop/waiting ureadahead-other stop/waiting sshd start/running, process 26834 tty (/dev/tty3) start/running, process 4362 tty (/dev/tty2) start/running, process 27957 tty (/dev/tty1) start/running, process 4358 tty (/dev/tty4) start/running, process 4364 control-alt-delete stop/waiting mountall stop/waiting rcS stop/waiting mountall-reboot stop/waiting mountall-shell stop/waiting start-ttys stop/waiting rcS-sulogin stop/waiting ureadahead stop/waiting i've built packages today, sshd is irrelevant here even if it has recent -D fix, and syslog-ng is not yet known as upstart service, package install is not yet finished. # pkgbytime | grep upstart Tue Apr 20 20:42:46 2010 vim-syntax-upstart-0.1-1.noarch Sun May 2 21:26:26 2010 upstart-SysVinit-2.86-24.i686 Sun May 9 11:22:01 2010 upstart-0.6.5-2.2.i686 Sun May 9 11:24:18 2010 openssh-server-upstart-5.5p1-2.1.i686 # initctl status syslog initctl: Unknown job: syslog # initctl status syslog-ng initctl: Unknown job: syslog-ng -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sun, May 09, 2010 at 12:26:56PM +0300, Elan Ruusamäe wrote: On Sunday 09 May 2010 12:00:57 Jacek Konieczny wrote: also seems the nice service name is lost there (see sshd part). How is that supposed to work and where is that 'sshd part'? line 1 and 3 - the nice name, line 4 plain service name 3: * Stopping OpenSSH service[ DONE ] 4: * Starting sshd service...[ DONE ] Oh, you mean that. Do you have an idea how to solve this, keeping things simple? I don't won't anything overly complicated for such a trivial cosmetic problem. Especially that these messages will not be displayed on boot, only during manual start/stop with 'service' or during package install or upgrades, when user knows what is happening. Greets, Jacek ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Friday 07 May 2010 16:33:21 Jacek Konieczny wrote: Some documentation for the rc-scripts+upstart usage is here: http://svn.pld-linux.org/cgi-bin/viewsvn/rc-scripts/branches/upstart_native /doc/upstart.txt?rev=11395view=markup does $JOB=_ has special meaning? ... emit starting JOB=_ SERVICE=syslog -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Sat, May 08, 2010 at 05:07:35PM +0300, Elan Ruusamäe wrote: On Friday 07 May 2010 16:33:21 Jacek Konieczny wrote: Some documentation for the rc-scripts+upstart usage is here: http://svn.pld-linux.org/cgi-bin/viewsvn/rc-scripts/branches/upstart_native /doc/upstart.txt?rev=11395view=markup does $JOB=_ has special meaning? No, as far as I know. ... emit starting JOB=_ SERVICE=syslog I thought init script should not emit 'started' event exactly as a job would do, but then I changed my mind. I guess I have not update the doc after I have changed the script. Greets, Jacek ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: Native upstart scripts – implemented
On Friday 07 May 2010 16:33:21 Jacek Konieczny wrote: Patryk Zawadzki pat...@pld-linux.org wrote: I'd opt for having 2 separate -init subpackages, one with the current rc.d contents and one with an upstart job description and a simple rc.d wrapper that runs start $foo, stop $foo etc. -upstart subpackages done. Addin -init makes no sense, as current upstart job handling implementaion relies on the init.d scripts for LSB compatibility and doing things not doable with bare Upstart (non-SIGHUP-reloading, 'checkconfig', advanced status monitoring). i'd rather avoid completely the new subpackage here, if needed move the /etc/init dir to filesystem package to avoid dirdeps pulling upstart, and use conflicts tag for the current requires tag. Some documentation for the rc-scripts+upstart usage is here: http://svn.pld-linux.org/cgi-bin/viewsvn/rc-scripts/branches/upstart_native /doc/upstart.txt?rev=11395view=markup syslog-ng/syslog-ng.init: ... upstart_controlled --except configtest i don't really understand how flush-logs is handled, or it's just not perfectly implemented yet? also how do you specify multiple excludes remains unclear. also, configtest before reload/restart action would be really important to have in upstart as well, considering that we restart services on rpm upgrades. does upstart have such concept after all as restart/reload in scripts? ps: would be nice to know where's source of documentation, for example i did not find myself description of job file directives. -- glen ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en