From root@spitfire.303.krakow.pl  Mon Dec 24 06:26:20 2001
Return-Path: <root@spitfire.303.krakow.pl>
Received: from spitfire.303.krakow.pl (spitfire.303.krakow.pl [62.233.162.193])
	by hub.freebsd.org (Postfix) with SMTP id 2885537B416
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 24 Dec 2001 06:26:19 -0800 (PST)
Received: (qmail 50907 invoked by uid 0); 24 Dec 2001 14:26:11 -0000
Message-Id: <20011224142611.50906.qmail@spitfire.303.krakow.pl>
Date: 24 Dec 2001 14:26:11 -0000
From: Jan Srzednicki <winfried@ikar.pl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: small change in /etc/periodic/*/999.local
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         33149
>Category:       conf
>Synopsis:       small change in /etc/periodic/*/999.local
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cjc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 24 06:30:01 PST 2001
>Closed-Date:    Thu Jan 10 00:24:09 PST 2002
>Last-Modified:  Thu Jan 10 00:26:41 PST 2002
>Originator:     Jan Srzednicki
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
MPS, Krakow, Poland
>Environment:
System: 
FreeBSD ikar.pl 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Tue Sep 25 18:07:30 CEST 2001     root@ikar.pl:/usr/obj/usr/src/sys/DEDAL  i386


	
>Description:

The /etc/periodic/*/999.local script will only allow to run a sh script.
Suerly you can put other scripts in cron, but I think it would be nice to 
have such scripts run via periodic.conf (and receive daily reports from 
in one mail). 

>How-To-Repeat:

Try to use anything other than a sh script in there.

>Fix:

Here's a simple diff:

root@ikar:/etc/periodic/daily# diff -uN 999.local.old 999.local 
--- 999.local.old       Wed Aug  1 22:38:03 2001
+++ 999.local   Mon Dec 24 15:04:59 2001
@@ -20,8 +20,10 @@
     echo ''
     case "$script" in
        /*)
-           if [ -f "$script" ]
-           then
+           if [ -x "$script" ]; then
+               echo "Running $script:"
+               $script || rc=3
+           elif [ -f "$script" ]; then
                echo "Running $script:"
 
                sh $script || rc=3

>Release-Note:
>Audit-Trail:

From: "Crist J . Clark" <cjc@FreeBSD.ORG>
To: Jan Srzednicki <winfried@ikar.pl>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/33149: small change in /etc/periodic/*/999.local
Date: Thu, 27 Dec 2001 14:52:47 -0800

 On Mon, Dec 24, 2001 at 02:26:11PM -0000, Jan Srzednicki wrote:
 [snip]
 
 > The /etc/periodic/*/999.local script will only allow to run a sh script.
 > Suerly you can put other scripts in cron, but I think it would be nice to 
 > have such scripts run via periodic.conf (and receive daily reports from 
 > in one mail). 
 
 As stated in the comments for the 999.local script, it only really
 exists for back compatibilty with /etc/daily.local.
 
 For the functionality you desire, the recommended way to go is to use
 functionality built into periodic(8). Drop your "scripts" into
 /usr/local/etc/periodic/daily/. The "script" may be any executable
 file and not just a shell script.
 
 Since this is the preferred and supported way to do this and it has
 the functionality you desire, unless you have further argument why the
 support is also needed in 999.local, I'll close up the PR in a day or
 two.
 -- 
 "It's always funny until someone gets hurt. Then it's hilarious."
 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
Responsible-Changed-From-To: freebsd-bugs->cjc 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Jan 9 01:08:57 PST 2002 
Responsible-Changed-Why:  
Crist will probably close this in a few days. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33149 
State-Changed-From-To: open->closed 
State-Changed-By: cjc 
State-Changed-When: Thu Jan 10 00:24:09 PST 2002 
State-Changed-Why:  
The preferred way to do this is to use the /usr/local/periodic/daily 
directory. No feedback from submitter on why this is not an adequate 
solution. 
GNATS: Enter the reason for changing this PR's status here. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33149 
>Unformatted:
