services output oddity
Tom H
tomh0665 at gmail.com
Sat Jul 2 21:05:34 UTC 2011
On Sat, Jul 2, 2011 at 4:20 PM, Dave Stevens <geek at uniserve.com> wrote:
>
> It's handy to check that some service or other is up and running without
> necessarily invoking the service. Enter the U10.04 service command.
>
> # service --status-all > servicesrunning.txt
> [ ? ] anacron
> [ ? ] console-screen.sh
> [ ? ] cron
> [ ? ] fetchmail
> [ ? ] hostname
> [ ? ] hwclock
> [ ? ] hwclock-save
> [ ? ] keymap.sh
> [ ? ] killprocs
> [ ? ] libpam-foreground
> [ ? ] mailman
> [ ? ] module-init-tools
> [ ? ] modules_dep.sh
> [ ? ] mysql
> [ ? ] network-interface
> [ ? ] network-interface-security
> [ ? ] networking
> [ ? ] nmbd
> [ ? ] ondemand
> [ ? ] plymouth
> [ ? ] plymouth-log
> [ ? ] plymouth-splash
> [ ? ] plymouth-stop
> [ ? ] portmap
> [ ? ] portmap-boot
> [ ? ] portmap-wait
> [ ? ] procps
> [ ? ] rc.local
> [ ? ] saslauthd
> [ ? ] screen-cleanup
> [ ? ] sendsigs
> [ ? ] smbd
> [ ? ] stop-bootlogd
> [ ? ] stop-bootlogd-single
> [ ? ] udev
> [ ? ] udev-finish
> [ ? ] udevmonitor
> [ ? ] udevtrigger
> [ ? ] umountfs
> [ ? ] umountnfs.sh
> [ ? ] umountroot
> [ ? ] usermin
> [ ? ] vzquota
> [ ? ] webmin
>
> given the command line above I would have expected the output text to go
> into a file called servicesrunning.txt, not on screen. But the above output
> is the screen text.
>
> There IS text in the new file servicesrunning.txt, like this:
>
> dave at cl28810:~$ cat servicesrunning.txt
> [ + ] apache2
> [ + ] bind9
> [ - ] bootlogd
> [ + ] clamav-daemon
> [ + ] clamav-freshclam
> [ - ] dovecot
> [ - ] klogd
> [ - ] postfix
> [ + ] postgresql-8.4
> [ + ] proftpd
> [ + ] quota
> [ - ] quotarpc
> [ - ] rsync
> [ - ] sendmail
> [ + ] spamassassin
> [ + ] ssh
> [ + ] sysklogd
> [ + ] sysstat
> [ - ] urandom
> [ - ] wide-dhcpv6-client
> [ + ] xinetd
>
> So NOT the same text, less detail. Apparently only a summary goes into the
> text file.
>
> Anyone know why this behaviour? Why on screen, why summary only on file?
It's stderr that's displayed and stdout that's saved to "servicesrunning.txt".
If you want everything to end up in "servicesrunning.txt", you have to
run "service --status-all > servicesrunning.txt 2>&1".
More information about the ubuntu-users
mailing list