NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/58408: cron ignores parameter "-n" in crontab



The following reply was made to PR bin/58408; it has been noted by GNATS.

From: Christos Zoulas <christos%zoulas.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/58408: cron ignores parameter "-n" in crontab
Date: Sun, 21 Jul 2024 15:45:07 -0400

 I just tried your example and it worked as expected
 
 log_it: (christos 5384) CMD START (/u/christos/cron1)
 log_it: (christos 15992) CMD START (/u/christos/cron2)
 [4179] child continues, closing pipes
 [4179] child reading output from grandchild
 [13945] child continues, closing pipes
 [13945] child reading output from grandchild
 [7886] child continues, closing pipes
 [7886] child reading output from grandchild
 [4179] got EOF from grandchild [0]
 log_it: (christos 4179) CMD FINISH (/usr/bin/true)
 [4179] child process done (rc=3D0), exiting
 [20135] sigchld...pid #4179 died, stat=3D0
 [20135] sigchld...no dead kids
 [7886] got data (77:w) from grandchild
 [7886] aborting pipe to mail
 [13945] got data (77:w) from grandchild
 [13945] closing pipe to mail
 [13945] got EOF from grandchild [0]
 log_it: (christos 13945) CMD FINISH (/u/christos/cron2)
 [13945] child process done (rc=3D0), exiting
 [20135] sigchld...pid #13945 died, stat=3D0
 [20135] sigchld...no dead kids
 
 you can try running cron -x proc
 
 
 christos
 
 > On Jul 9, 2024, at 3:35=E2=80=AFAM, nmingotti%gmail.com@localhost wrote:
 >=20
 >> Number:         58408
 >> Category:       bin
 >> Synopsis:       cron ignores parameter "-n" in crontab
 >> Confidential:   no
 >> Severity:       non-critical
 >> Priority:       medium
 >> Responsible:    bin-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Tue Jul 09 07:35:00 +0000 2024
 >> Originator:     Dr. Nicola Mingotti
 >> Release:        10.0
 >> Organization:
 > Borghi SRL
 >> Environment:
 > NetBSD pulce4 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 08:33:33 UTC =
 2024  =
 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/GENERIC =
 evbarm
 >=20
 >> Description:
 > According to man page crontab (5), if the modifier '-n' is used before =
 a command no mail should be sent on successful run. This is not the =
 case, parameter '-n' is ignored. Example below.=20
 >=20
 >=20
 >=20
 >=20
 >> How-To-Repeat:
 >=20
 > ---- /home/p/bin/test3.sh ----------
 > #!/bin/sh
 > echo "test3.sh -- `date` " >> /home/p/bin/test.log
 > echo "write something and quit. "
 > exit 0
 > ------------------------------------
 >=20
 > ---- /home/p/bin/test4.sh ----------
 > #!/bin/sh
 > echo "test4.sh -- `date` " >> /home/p/bin/test.log
 > echo "write something and fail"
 > exit 1
 > ------------------------------------
 >=20
 > p@pulce4 $> crontab -l=20
 > -----------
 > #
 > #minute hour    mday    month   wday    command
 > */1     *       *       *       *        -n /home/p/bin/test3.sh
 > */1     *       *       *       *        -n /home/p/bin/test4.sh
 > -----------
 >=20
 > . wait a bit
 > p@pulce4> mail=20
 > ----
 > N 14 root@pulce4.localdom  Tue Jul  9 08:55   3/695   "Cron <p@pulce4> =
 /home/p/bin/test3.sh"
 > N 15 root@pulce4.localdom  Tue Jul  9 08:56   3/693   "Cron <p@pulce4> =
 /home/p/bin/test4.sh"
 > N 16 root@pulce4.localdom  Tue Jul  9 08:56   3/695   "Cron <p@pulce4> =
 /home/p/bin/test3.sh"
 > N 17 root@pulce4.localdom  Tue Jul  9 08:57   3/693   "Cron <p@pulce4> =
 /home/p/bin/test4.sh"
 > N 18 root@pulce4.localdom  Tue Jul  9 08:57   3/695   "Cron <p@pulce4> =
 /home/p/bin/test3.sh"
 > N 19 root@pulce4.localdom  Tue Jul  9 08:58   3/693   "Cron <p@pulce4> =
 /home/p/bin/test4.sh"
 > N 20 root@pulce4.localdom  Tue Jul  9 08:58   3/695   "Cron <p@pulce4> =
 /home/p/bin/test3.sh"
 > N 21 root@pulce4.localdom  Tue Jul  9 08:59   3/693   "Cron <p@pulce4> =
 /home/p/bin/test4.sh"
 > N 22 root@pulce4.localdom  Tue Jul  9 08:59   3/695   "Cron <p@pulce4> =
 /home/p/bin/test3.sh"
 > ----
 >=20
 >=20
 >=20
 >=20
 >=20
 >=20
 >> Fix:
 >=20
 


Home | Main Index | Thread Index | Old Index