NetBSD Problem Report #50567

From www@NetBSD.org  Thu Dec 17 01:40:47 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2ED127ACD0
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 17 Dec 2015 01:40:47 +0000 (UTC)
Message-Id: <20151217014046.18E577ACD1@mollari.NetBSD.org>
Date: Thu, 17 Dec 2015 01:40:46 +0000 (UTC)
From: Tr@visPaul.me
Reply-To: Tr@visPaul.me
To: gnats-bugs@NetBSD.org
Subject: sysutils/salt: Fix cron module for SmartOS, Solaris, AIX
X-Send-Pr-Version: www-1.0

>Number:         50567
>Category:       pkg
>Synopsis:       sysutils/salt: Fix cron module for SmartOS, Solaris, AIX
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    solaris-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 17 01:45:00 +0000 2015
>Closed-Date:    Tue Feb 09 14:23:42 +0000 2016
>Last-Modified:  Tue Feb 09 14:25:01 +0000 2016
>Originator:     Travis Paul
>Release:        trunk
>Organization:
>Environment:
SunOS nessie 5.11 joyent_20151126T062747Z i86pc i386 i86pc
>Description:
The cron module in salt does not work completely with SmartOS, and likely Solaris and AIX.

This patch only makes the cron module functional for the user that is running salt, but in my case, and I assume others using these operating systems, that is better than the module not working at all. A better long-term fix may be need to be found.

There is an unmerged pull request here: https://github.com/saltstack/salt/pull/29777
>How-To-Repeat:
Attempt to use the cron salt module to add new entries to the crontab it will fail with:

[root@salt ~]# salt MYMINION state.highstate
MYMINION:
 [snip]
----------
          ID: zpool scrub zones
    Function: cron.present
      Result: False
     Comment: Cron zpool scrub zones for user root failed to commit with error 
              crontab: illegal option -- u
              crontab: usage:
                crontab [file]
                crontab -e [username]
                crontab -l [-g] [username]
                crontab -r [username]
     Started: 01:32:01.217816
    Duration: 427.723 ms
     Changes:   
[snip]
Summary for MYMINION
------------
Succeeded: 3
Failed:    2
------------
Total states run:     5
Total run time: 850.325 ms

>Fix:
commit ba76062950095850ec165be0be3584624da2046f
Author: Travis Paul <Tr@validusa.com>
Date:   Wed Dec 16 23:20:36 2015 +0000

    sysutils/salt: Fix cron module for SmartOS

    Upstream PR sent: https://github.com/saltstack/salt/pull/29777

diff --git a/sysutils/salt/Makefile b/sysutils/salt/Makefile
index 2cd7c5a..67cdc71 100644
--- a/sysutils/salt/Makefile
+++ b/sysutils/salt/Makefile
@@ -3,6 +3,7 @@
 DISTNAME=      salt-2015.8.3
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_PYPI:=s/salt/}
+PKGREVISION=   1

 MAINTAINER=    pkgsrc-users@NetBSD.org
 HOMEPAGE=      http://saltstack.org/
diff --git a/sysutils/salt/distinfo b/sysutils/salt/distinfo
index d64a7c8..0ac5803 100644
--- a/sysutils/salt/distinfo
+++ b/sysutils/salt/distinfo
@@ -4,3 +4,4 @@ SHA1 (salt-2015.8.3.tar.gz) = 0457866d5619febc3cdf3b27b2e736b0c4ae3623
 RMD160 (salt-2015.8.3.tar.gz) = 607db5d35545cfb6c4e8676482133a1560f3e896
 SHA512 (salt-2015.8.3.tar.gz) = 18a2c63d5e54d09468189450557974e47f87d8b7dde52beaae678120da1da1e7aecfff18cf0fdfb63a11cd5f6bab102c229462f0afe5e3e858c0c467761c7121
 Size (salt-2015.8.3.tar.gz) = 6757678 bytes
+SHA1 (patch-salt_modules_cron.py) = e271bfc252c5c9263d9029f2334ba742cc1be199
diff --git a/sysutils/salt/patches/patch-salt_modules_cron.py b/sysutils/salt/patches/patch-salt_modules_cron.py
new file mode 100644
index 0000000..4e5f389
--- /dev/null
+++ b/sysutils/salt/patches/patch-salt_modules_cron.py
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- salt/modules/cron.py.orig  2015-12-15 22:38:23.793040947 +0000
++++ salt/modules/cron.py
+@@ -150,7 +150,7 @@ def _get_cron_cmdstr(path, user=None):
+     '''
+     cmd = 'crontab'
+
+-    if user:
++    if user and __grains__.get('os_family') not in ('Solaris', 'AIX'):
+         cmd += ' -u {0}'.format(user)
+
+     return '{0} {1}'.format(cmd, path)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Thu, 17 Dec 2015 15:01:41 +0000
Responsible-Changed-Why:
two thirds Solaris bug report


From: Travis Paul <Tr@visPaul.me>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50567
Date: Sun, 7 Feb 2016 17:25:56 -0500

 This patch has been accepted upstream[1], but upstream has not yet made 
 a new release.  Can this patch be added or is it something I need to 
 continue to keep locally?

 [1] https://github.com/saltstack/salt/pull/29777

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/50567
Date: Mon, 8 Feb 2016 09:02:50 +0100

 On Sun, Feb 07, 2016 at 10:30:01PM +0000, Travis Paul wrote:
 >  This patch has been accepted upstream[1], but upstream has not yet made 
 >  a new release.  Can this patch be added or is it something I need to 
 >  continue to keep locally?
 >  
 >  [1] https://github.com/saltstack/salt/pull/29777

 Patches that are already accepted upstream can be added to pkgsrc
 without problems, you just have to find a committer for it ;)
  Thomas

From: Travis Paul <Tr@visPaul.me>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50567
Date: Mon, 8 Feb 2016 22:59:17 -0500

 Updated patch for latest changes to package

 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/sysutils/salt/Makefile,v
 retrieving revision 1.35
 diff -u -r1.35 Makefile
 --- Makefile    7 Feb 2016 23:55:01 -0000       1.35
 +++ Makefile    9 Feb 2016 03:58:04 -0000
 @@ -3,6 +3,7 @@
   DISTNAME=      salt-2015.8.5
   CATEGORIES=    sysutils
   MASTER_SITES=  ${MASTER_SITE_PYPI:=s/salt/}
 +PKGREVISION=   1

   MAINTAINER=    pkgsrc-users@NetBSD.org
   HOMEPAGE=      http://saltstack.org/
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/sysutils/salt/distinfo,v
 retrieving revision 1.18
 diff -u -r1.18 distinfo
 --- distinfo    7 Feb 2016 23:55:01 -0000       1.18
 +++ distinfo    9 Feb 2016 03:58:04 -0000
 @@ -5,3 +5,4 @@
   SHA512 (salt-2015.8.5.tar.gz) = 
 715709798fd1f4410ef204545a84e34d3ecc0f080905b7ae29ce19d273c1ed6865f56e025e59d2506301970ad05081ff119caec0ced03dcbe5803f9f00eb64f8
   Size (salt-2015.8.5.tar.gz) = 6877624 bytes
   SHA1 (patch-salt_modules_status.py) = 
 5253782b046c2f7b809682f52ce4d04dab1c81ac
 +SHA1 (patch-salt_modules_cron.py) = 
 e271bfc252c5c9263d9029f2334ba742cc1be199
 cvs diff: Diffing files
 cvs diff: Diffing files/smf
 cvs diff: Diffing patches
 Index: patches/patch-salt_modules_cron.py
 ===================================================================
 RCS file: patches/patch-salt_modules_cron.py
 diff -N patches/patch-salt_modules_cron.py
 --- /dev/null   1 Jan 1970 00:00:00 -0000
 +++ patches/patch-salt_modules_cron.py  9 Feb 2016 03:58:04 -0000
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- salt/modules/cron.py.orig  2015-12-15 22:38:23.793040947 +0000
 ++++ salt/modules/cron.py
 +@@ -150,7 +150,7 @@ def _get_cron_cmdstr(path, user=None):
 +     '''
 +     cmd = 'crontab'
 +
 +-    if user:
 ++    if user and __grains__.get('os_family') not in ('Solaris', 'AIX'):
 +         cmd += ' -u {0}'.format(user)
 +
 +     return '{0} {1}'.format(cmd, path)

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 09 Feb 2016 14:23:42 +0000
State-Changed-Why:
Committed, thanks.
I moved PKGREVISION higher, where it usually is.
I also added a comment to the patch explaining what it does,
and citing the upstream pull request.


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50567 CVS commit: pkgsrc/sysutils/salt
Date: Tue, 9 Feb 2016 14:23:04 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Tue Feb  9 14:23:04 UTC 2016

 Modified Files:
 	pkgsrc/sysutils/salt: Makefile distinfo
 Added Files:
 	pkgsrc/sysutils/salt/patches: patch-salt_modules_cron.py

 Log Message:
 Add upstream patch fixing problem with cron on Solaris.

 From Travis Paul in PR 50567.
 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.35 -r1.36 pkgsrc/sysutils/salt/Makefile
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/sysutils/salt/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/sysutils/salt/patches/patch-salt_modules_cron.py

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.