the ps utility and cron

Sergey Zaikov Sergey_Zaikov at p66.f5.klax.tsu.tula.ru
Tue Apr 22 08:30:58 PDT 2003


                   Hello, Questions at freebsd.Org!!!

I have a question about a key -x from man ps(1).
The reason of my question may be: misunderstanding man ps(1), errata at man
ps(1) or error in ps utility.

(My FreeBSD version:
FreeBSD acc.acc.tula.ru 4.7-RELEASE FreeBSD 4.7-RELEASE #38: Thu Mar 20
09:31:30 MSK 2003     acc107_3 at acc.acc.tula.ru:/usr/obj/usr/src/sys/Z  i386)

Man ps (1) says:
[*SKIP*]
 -x      Display information about processes without controlling termi-
         nals.
[*SKIP*]
A processes, started from cron, is processes without controlling terminals. (Or
I samething don't understand:)
So:
$> ps -ax -U acc107_3
must diplays it and
$>ps -a -U acc107_3
should don't displays this processes.

I do easy test:

I write at crontab: 0 11 * * * /bin/sleep 60
and wait for 11-00 time.

At 11-00 I do:
   For user 'acc107_3':
acc:/usr/export/acc107_3>ps -ax -U acc107_3
  PID  TT  STAT      TIME COMMAND
  544  ??  Ss     0:00,00 /bin/sh -c /bin/sleep 60
  545  ??  S      0:00,00 /bin/sleep 60
  473  p0  Ss+    0:00,12 -tcsh (tcsh)
  474  p1  Rs     0:00,12 -tcsh (tcsh)
  548  p1  R+     0:00,00 ps -ax -U acc107_3
acc:/usr/export/acc107_3>ps -a -U acc107_3
  PID  TT  STAT      TIME COMMAND
  544  ??  Ss     0:00,00 /bin/sh -c /bin/sleep 60
  545  ??  S      0:00,00 /bin/sleep 60
  473  p0  Ss+    0:00,12 -tcsh (tcsh)
  474  p1  Ss     0:00,12 -tcsh (tcsh)
  549  p1  R+     0:00,00 ps -a -U acc107_3
  For user 'root':
acc:/usr/export/acc107_3>ps -a -U acc107_3
  PID  TT  STAT      TIME COMMAND
  544  ??  Is     0:00,00 /bin/sh -c /bin/sleep 60
  545  ??  I      0:00,00 /bin/sleep 60
  473  p0  Is+    0:00,12 -tcsh (tcsh)
  474  p1  Is+    0:00,12 -tcsh (tcsh)
  551  p2  Is     0:00,03 -tcsh (tcsh)
acc:/usr/export/acc107_3>ps -ax -U acc107_3
  PID  TT  STAT      TIME COMMAND
  544  ??  Is     0:00,00 /bin/sh -c /bin/sleep 60
  545  ??  I      0:00,00 /bin/sleep 60
  473  p0  Is+    0:00,12 -tcsh (tcsh)
  474  p1  Is+    0:00,12 -tcsh (tcsh)
  551  p2  Is     0:00,03 -tcsh (tcsh)

At both cases, the processes, started by cron, always displays.

Is it right?

Thank you.

                                                          Sergey.
... úÎÁÎÉÅ - ÓÔÏÌØ ÄpÁÇÏÃÅÎÎÁÑ ×ÅÝØ, ÞÔÏ ÅÇÏ ÎÅ ÚÁÚÏpÎÏ ÄÏÂÙ×ÁÔØ ÉÚ ÌÀÂÏÇÏ


More information about the freebsd-questions mailing list