init(8) not executing everything cron, getty on some hosts
Hi, I've been experiencing a strange problem with one of my hosts (I think, since upgrading to 9.1-RELEASE). The host does not start several services after booting, especially no getty(8)s and no cron(8). When starting these services manually, it does so without flaw (you can login via ssh). I thought about that maybe being a hardware failure, as this host also refuses to boot 9.2-RELEASE because of something timer-specific. Now, upgrading two other hosts to 9.2-RELEASE, one of them with the same hardware, they suddenly show the same behaviour: No getty(8)s are started (though by hand, it works), no cron (by hand, again, it works), and on one host no kdc (again, by hand you can start it). On the other hand, another host upgraded to 9.2-RELEASE behaves as it should, starting all services. On the console, there are no errors, there is just no further message after the last service (ntpd or sshd) is started. I don't think it's a hardware issue, as one of the three machines runs on different hardware than the other two (which are identical). Everything is as standard as possible. My ttys(5) is the standard one (comments and serial line left out): console noneunknown off secure ttyv0 /usr/libexec/getty Pc xterm on secure ttyv1 /usr/libexec/getty Pc xterm on secure ttyv2 /usr/libexec/getty Pc xterm on secure ttyv3 /usr/libexec/getty Pc xterm on secure ttyv4 /usr/libexec/getty Pc xterm on secure ttyv5 /usr/libexec/getty Pc xterm on secure ttyv6 /usr/libexec/getty Pc xterm on secure ttyv7 /usr/libexec/getty Pc xterm on secure ttyv8 /usr/local/bin/xdm -nodaemon xterm off secure My rc.conf(5) (this should not affect starting gettys), the second host does not even have jails: fsck_y_enable=YES dumpdev=AUTO ip_kerberos2=XXX ip_ldap1=XXX hostname=XXX ipv4_addrs_bge0=XXX $ip_ldap1 $ip_kerberos2 defaultrouter=XXX ezjail_enable=YES jail_flags=-s 3 nfs_client_enable=YES rpcbind_enable=YES rpc_statd_enable=YES rpc_lockd_enable=YES kerberos5_server_enable=YES saslauthd_enable=YES saslauthd_flags=-a kerberos5 slapd_enable=YES slapd_flags='-c 147 -h ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap:/// ldaps:///' slapd_sockets=/var/run/openldap/ldapi slapd_sockets_mode=666 nrpe2_enable=YES nut_upsmon_enable=YES munin_node_enable=YES sshd_enable=YES ntpd_enable=YES ntpd_sync_on_start=YES fscd_enable=YES bsdstats_enable=YES Do you have any clues what could have gone wrong? freebsd-update's IDS does not show any wrong checksums. Regards, Julian signature.asc Description: PGP signature
Re: init(8) not executing everything cron, getty on some hosts
Hi, On Mon, 7 Oct 2013 10:47:09 +0200 Julian Fagir wrote: I don't think it's a hardware issue, as one of the three machines runs on different hardware than the other two (which are identical). I have to update on that: The two servers with the identical hardware are the ones with the real issue. It's about a Proliant DL385 G1. The other one just got into an inconsistent state with the update, thinking it's with 9.2-RELEASE, but apparently not having upgraded anything. Regards, Julian signature.asc Description: PGP signature
test if script called by cron
Hi, Is there a simple way of testing whether a given script was called via cron, I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab. thanks Paul. (anyone here going to EuroBSD con?) -- - Paul Macdonald IFDNRG Ltd Web and video hosting - t: 0131 5548070 m: 07970339546 e: p...@ifdnrg.com w: http://www.ifdnrg.com - IFDNRG 40 Maritime Street Edinburgh EH6 6SA High Specification Dedicated Servers from £100.00pm ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: test if script called by cron
On Mon, 16 Sep 2013 12:26:59 +0100, Paul Macdonald wrote: Is there a simple way of testing whether a given script was called via cron, I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab. I'd suggest the script creates a file (lock file or, much easier, just a simple normal file) at its beginning: #!/bin/sh /usr/bin/touch /tmp/scriptrun # ... your script content here ... You could also output the date command to that file to see when the script has been called: #!/bin/sh /bin/date +%Y-%m-%d %H:%M:%S /tmp/scriptrun # ... your script content here ... Of course you would have to manually remove that file after you have verified its existence and content. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: test if script called by cron
In the last episode (Sep 16), Paul Macdonald said: Is there a simple way of testing whether a given script was called via cron, I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab. You check to see if stdin is a terminal, but that's not conclusive. One way to know for sure is to look at the name of the process that launched you: if [ ! -t 0 ] ; then echo no tty, possibly run from cron fi parent=$(ps -o command= -p $PPID) case $parent in *cron* ) echo parent is $parent, almost certainly cron ;; esac -- Dan Nelson dnel...@allantgroup.com ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: test if script called by cron
On Mon, 16 Sep 2013 12:26:59 +0100 Paul Macdonald articulated: Hi, Is there a simple way of testing whether a given script was called via cron, I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab. thanks Paul. (anyone here going to EuroBSD con?) If you want to learn if the running script was called via cron, this would work, assuming you are running Bash. if [[ ! -t 0 ]]; then echo Running from Cron fi -- Jerry ♔ Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: test if script called by cron
On Mon, 16 Sep 2013 23:28:17 -0400, kpn...@pobox.com wrote: On Mon, Sep 16, 2013 at 02:05:04PM +0200, Polytropon wrote: On Mon, 16 Sep 2013 12:26:59 +0100, Paul Macdonald wrote: Is there a simple way of testing whether a given script was called via cron, I'd rather find a solution that would work from within the script rather than setting an environment variable in the crontab. I'd suggest the script creates a file (lock file or, much easier, just a simple normal file) at its beginning: #!/bin/sh /usr/bin/touch /tmp/scriptrun # ... your script content here ... Wouldn't the lockf command be better than touch? That way you get the condition code telling you whether or not the script is already running. Yes, it would probably be better in this case. This, in combination with the suggestion of test-t 0 to check if the script has been interactively called or not, looks like a better solution. However, the intial question does not make fully sure (at least to me as a non-native speaker) if the intention is (a) to check _if_ the script has been run via cron, or (b) to check if the script has been run via _cron_. :-) Of course you would have to manually remove that file after you have verified its existence and content. If you use lockf as a drop-in replacement for touch then, yes, you'll need to keep the lock file until removing it at the end of the script. Depends. Let's say the script is scheduled at 3:00 and will finish in about half an hour. The evidence file will only be visible from 3:00 to ca. 3:30, so removing the evidence file after the script has finished could lead to a false-negative result (has not been run). This is also true for the more simple solution using the touch command (no rm call at the end of the script). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
cron pile up! libnss-mysql and cron (Rehash)
4.5 years ago, I posted about cron's piling up. It seems if I install libnss-mysql on a fresh 9.0-STABLE, this problem persists. Here was the original post: http://lists.freebsd.org/pipermail/freebsd-questions/2007-December/164174.html I've seen this on 6.2, 7.x, and now 9.0 FreeBSD. How to repeat: install a fresh BSD system, install libnss-mysql, wait a few days. System info: FreeBSD 9.0-STABLE amd64 libnss-mysql-1.5_3 NSS module using a MySQL database for backend mariadb-client-5.3.6 Database server - drop-in replacement for MySQL mariadb-server-5.3.6 Database server - drop-in replacement for MySQL ps axlw | grep cron 0 56084 1 0 20 0 31064 2844 nanslp IsJ ?? 0:00.78 /usr/sbin/cron -s 0 68402 56084 0 20 0 31064 2844 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68403 68402 0 20 0 31064 2844 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68527 56084 0 20 0 31064 2848 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68528 56084 0 20 0 31064 2844 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68530 68527 0 20 0 31064 2848 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68531 68528 0 20 0 31064 2844 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68558 56084 0 20 0 31064 2844 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68559 68558 0 20 0 31064 2844 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68591 56084 0 20 0 31064 2844 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68592 68591 0 20 0 31064 2844 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68608 56084 0 20 0 31064 2848 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68609 68608 0 20 0 31064 2848 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68659 56084 0 20 0 31064 2848 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68660 68659 0 20 0 31064 2848 sbwait IVsJ ?? 0:00.00 cron: running job (cron) 0 68683 56084 0 20 0 31064 2844 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68684 68683 0 20 0 31064 2844 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) 0 68722 56084 0 21 0 31064 2848 ppwait DJ ?? 0:00.00 cron: running job (cron) 0 68723 68722 0 20 0 31064 2848 so_rcv_s IVsJ ?? 0:00.00 cron: running job (cron) Interestingly, if I do a truss and hit ^C, the process disappears... see below: # truss -p 68684 ^C # truss -p 68684 truss: can not attach to target process: No such process # grep 68684 /var/log/cron Jun 22 16:25:00 mail /usr/sbin/cron[68684]: (root) CMD (/usr/libexec/atrun) Rudy ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
cron pile up! Lot's of cron: running job (cron)
http://lists.freebsd.org/pipermail/freebsd-questions/2007-December/164174.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Tue, 12 Jun 2012 12:21:31 -0500, Dan Lists wrote: The syntax of his crontab file is correct. Vixie cron does care about leading spaces, tabs, extra spaces, or leading zeros. Earlier versions of cron are much pickier about the crontab file. The cron logs show that it is starting his jobs at the correct times. It is far more likely that there is a problem with the scripts. A very common cause of problems with scripts run from cron is that they do not inherit your environment. Do the scripts run from the command line? If the do, then the problem is most likely something in your environment that the scripts need. I'm a complete idiot, and I feel embarrassed. Everything was fine, except that I had missed out '/bin' in the paths of the jobs. I had: /home/walterh/exports.sh /home/walterh/backup_etc.sh /home/walterh/systemcheck.sh /home/walterh/backup_bsd.sh which should of course have been: /home/walterh/bin/exports.sh /home/walterh/bin/backup_etc.sh /home/walterh/bin/systemcheck.sh /home/walterh/bin/backup_bsd.sh What a stupid mistake! Thanks for all the replies, but I must say sorry for wasting your time. Sorry! WH ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On 6/13/2012 6:23 PM, Walter Hurry wrote: On Tue, 12 Jun 2012 12:21:31 -0500, Dan Lists wrote: The syntax of his crontab file is correct. Vixie cron does care about leading spaces, tabs, extra spaces, or leading zeros. Earlier versions of cron are much pickier about the crontab file. The cron logs show that it is starting his jobs at the correct times. It is far more likely that there is a problem with the scripts. A very common cause of problems with scripts run from cron is that they do not inherit your environment. Do the scripts run from the command line? If the do, then the problem is most likely something in your environment that the scripts need. I'm a complete idiot, and I feel embarrassed. Everything was fine, except that I had missed out '/bin' in the paths of the jobs. I had: /home/walterh/exports.sh /home/walterh/backup_etc.sh /home/walterh/systemcheck.sh /home/walterh/backup_bsd.sh which should of course have been: /home/walterh/bin/exports.sh /home/walterh/bin/backup_etc.sh /home/walterh/bin/systemcheck.sh /home/walterh/bin/backup_bsd.sh What a stupid mistake! Thanks for all the replies, but I must say sorry for wasting your time. Sorry! WH ... Damned those full path names. -- Keep well, Chris ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On 11/06/2012 23:10, Michael Sierchio wrote: On Mon, Jun 11, 2012 at 7:04 PM, Walter Hurry walterhu...@gmail.com wrote: As the subject says, this is probably a newbie question (I am new to FreeBSD but quite experienced at Linux). FreeBSD9 on x86_64. Cron is running: $ ps -ax|grep cron 1513 ?? Is 0:00.01 /usr/sbin/cron -s 2283 0 S+ 0:00.00 grep cron $ I have a syntactically valid crontab: $ crontab -l #min hr dom month dow command SHELL=/bin/bash Pitfall: Even if bash is installed, it's not usually under /bin, but under /usr/local/bin PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ daddy/bin HOME=/home/walterh 00 02 * * * /home/walterh/exports.sh 05 02 * * * /home/walterh/backup_etc.sh 10 02 * * * /home/walterh/systemcheck.sh 15 02 * * * /home/walterh/backup_bsd.sh $ So what is wrong? Why is nothing happening? I have consulted the handbook but see nothing. Have you installed bash? It's not in the system base. What's in your shell scripts? - M ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Tue, 12 Jun 2012 00:06:21 -0500, Robert Bonomi bon...@mail.r-bonomi.com wrote: Comment: using a leading zero on the numeric fields is a BAD IDEA(tm) -- you are *strongly* encocuraged to remove them. Yes, that means numbers will not be column aligned, but it is a small price to pay to avoid the hair-tearing that =will= ensue when using it bites you. Any other info on this? I've never heard of this before and I've never seen an issue using leading zeroes on the minutes value. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
Mark Felder f...@feld.me writes: On Tue, 12 Jun 2012 00:06:21 -0500, Robert Bonomi bon...@mail.r-bonomi.com wrote: Comment: using a leading zero on the numeric fields is a BAD IDEA(tm) -- you are *strongly* encocuraged to remove them. Yes, that means numbers will not be column aligned, but it is a small price to pay to avoid the hair-tearing that =will= ensue when using it bites you. Any other info on this? I've never heard of this before and I've never seen an issue using leading zeroes on the minutes value. I don't have ready access to source at the moment, but I would expect (like the normal C I/O functions) it will be interpreted as octal. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Tue, 12 Jun 2012 09:36:37 -0500, Lowell Gilbert freebsd-questions-lo...@be-well.ilk.org wrote: I don't have ready access to source at the moment, but I would expect (like the normal C I/O functions) it will be interpreted as octal. Suppose we could always ask Paul Vixie :-) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Tue, 12 Jun 2012 08:29:02 -0500, Mark Felder wrote: On Tue, 12 Jun 2012 00:06:21 -0500, Robert Bonomi bon...@mail.r-bonomi.com wrote: Comment: using a leading zero on the numeric fields is a BAD IDEA(tm) -- you are *strongly* encocuraged to remove them. Yes, that means numbers will not be column aligned, but it is a small price to pay to avoid the hair-tearing that =will= ensue when using it bites you. Any other info on this? I've never heard of this before and I've never seen an issue using leading zeroes on the minutes value. There are some specific interpretations that _may_ be interpreted according to the C rules, e. g. prefix 0x- for hexadecimal or 08- for octal notation. For example, 083 != 83, just as 0x83 != 83. As it has been mentioned, spaces also have a significant meaning in crontabs, so they cannot be used everywhere to align data columns. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Tue, Jun 12, 2012 at 12:06 PM, Polytropon free...@edvax.de wrote: On Tue, 12 Jun 2012 08:29:02 -0500, Mark Felder wrote: On Tue, 12 Jun 2012 00:06:21 -0500, Robert Bonomi bon...@mail.r-bonomi.com wrote: Comment: using a leading zero on the numeric fields is a BAD IDEA(tm) -- you are *strongly* encocuraged to remove them. Yes, that means numbers will not be column aligned, but it is a small price to pay to avoid the hair-tearing that =will= ensue when using it bites you. Any other info on this? I've never heard of this before and I've never seen an issue using leading zeroes on the minutes value. There are some specific interpretations that _may_ be interpreted according to the C rules, e. g. prefix 0x- for hexadecimal or 08- for octal notation. For example, 083 != 83, just as 0x83 != 83. As it has been mentioned, spaces also have a significant meaning in crontabs, so they cannot be used everywhere to align data columns. The syntax of his crontab file is correct. Vixie cron does care about leading spaces, tabs, extra spaces, or leading zeros. Earlier versions of cron are much pickier about the crontab file. The cron logs show that it is starting his jobs at the correct times. It is far more likely that there is a problem with the scripts. A very common cause of problems with scripts run from cron is that they do not inherit your environment. Do the scripts run from the command line? If the do, then the problem is most likely something in your environment that the scripts need. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Newbie question: Why aren't my cron jobs running?
As the subject says, this is probably a newbie question (I am new to FreeBSD but quite experienced at Linux). FreeBSD9 on x86_64. Cron is running: $ ps -ax|grep cron 1513 ?? Is 0:00.01 /usr/sbin/cron -s 2283 0 S+ 0:00.00 grep cron $ I have a syntactically valid crontab: $ crontab -l #min hr dom month dow command SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ daddy/bin HOME=/home/walterh 00 02 * * * /home/walterh/exports.sh 05 02 * * * /home/walterh/backup_etc.sh 10 02 * * * /home/walterh/systemcheck.sh 15 02 * * * /home/walterh/backup_bsd.sh $ So what is wrong? Why is nothing happening? I have consulted the handbook but see nothing. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Mon, Jun 11, 2012 at 7:04 PM, Walter Hurry walterhu...@gmail.com wrote: As the subject says, this is probably a newbie question (I am new to FreeBSD but quite experienced at Linux). FreeBSD9 on x86_64. Cron is running: $ ps -ax|grep cron 1513 ?? Is 0:00.01 /usr/sbin/cron -s 2283 0 S+ 0:00.00 grep cron $ I have a syntactically valid crontab: $ crontab -l #min hr dom month dow command SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ daddy/bin HOME=/home/walterh 00 02 * * * /home/walterh/exports.sh 05 02 * * * /home/walterh/backup_etc.sh 10 02 * * * /home/walterh/systemcheck.sh 15 02 * * * /home/walterh/backup_bsd.sh $ So what is wrong? Why is nothing happening? I have consulted the handbook but see nothing. Have you installed bash? It's not in the system base. What's in your shell scripts? - M ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Mon, 11 Jun 2012 19:10:21 -0700, Michael Sierchio wrote: Have you installed bash? It's not in the system base. What's in your shell scripts? Thanks for the quick response. $ pkg_info|grep bash bash-4.2.28 The GNU Project's Bourne Again SHell $ which bash /bin/bash $ $ less $HOME/bin/exports.sh #!/bin/bash LOG=$HOME/log/exports.log logger -t walterh-cronjob Exports started echo Exports started at `date` $LOG rm $HOME/postgresql/* psql packages -f $HOME/sql/exports.sql cd $HOME/postgresql tar cfz postgresql.tgz * rm *csv echo Exports finished at `date` $LOG logger -t walterh-cronjob Exports finished /home/walterh/bin/exports.sh (END) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Mon, Jun 11, 2012 at 7:25 PM, Walter Hurry walterhu...@gmail.com wrote: cat /etc/shells ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Mon, 11 Jun 2012 21:21:12 -0500, Adam Vande More wrote: You really have bash in /bin ? Are your scripts executable? What does /var/log/cron say? $ file /bin/bash /bin/bash: symbolic link to `/usr/local/bin/bash' $ sudo tail -50 /var/log/cron (result snipped at 02:22:00 for brevity) Jun 12 01:55:00 jupiter /usr/sbin/cron[1780]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:00:00 jupiter /usr/sbin/cron[1823]: (root) CMD (newsyslog) Jun 12 02:00:00 jupiter /usr/sbin/cron[1825]: (operator) CMD (/usr/ libexec/save-entropy) Jun 12 02:00:00 jupiter /usr/sbin/cron[1824]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:00:00 jupiter /usr/sbin/cron[1836]: (walterh) CMD (/home/ walterh/exports.sh) Jun 12 02:01:00 jupiter /usr/sbin/cron[1849]: (root) CMD (adjkerntz -a) Jun 12 02:05:00 jupiter /usr/sbin/cron[1874]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:05:00 jupiter /usr/sbin/cron[1875]: (walterh) CMD (/home/ walterh/backup_etc.sh) Jun 12 02:10:00 jupiter /usr/sbin/cron[1912]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:10:00 jupiter /usr/sbin/cron[1913]: (walterh) CMD (/home/ walterh/systemcheck.sh) Jun 12 02:11:00 jupiter /usr/sbin/cron[1924]: (operator) CMD (/usr/ libexec/save-entropy) Jun 12 02:15:00 jupiter /usr/sbin/cron[1981]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:15:00 jupiter /usr/sbin/cron[1982]: (walterh) CMD (/home/ walterh/backup_bsd.sh) Jun 12 02:20:00 jupiter /usr/sbin/cron[2013]: (root) CMD (/usr/libexec/ atrun) Jun 12 02:22:00 jupiter /usr/sbin/cron[2025]: (operator) CMD (/usr/ libexec/save-entropy) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On Mon, 11 Jun 2012 19:36:28 -0700, Michael Sierchio wrote: cat /etc/shells $ cat /etc/shells # $FreeBSD: release/9.0.0/etc/shells 59717 2000-04-27 21:58:46Z ache $ # # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/sh /bin/csh /bin/tcsh /usr/local/bin/bash /usr/local/bin/rbash $ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
On 6/11/2012 9:25 PM, Walter Hurry wrote: On Mon, 11 Jun 2012 19:10:21 -0700, Michael Sierchio wrote: Have you installed bash? It's not in the system base. What's in your shell scripts? Thanks for the quick response. $ pkg_info|grep bash bash-4.2.28 The GNU Project's Bourne Again SHell $ which bash /bin/bash $ $ less $HOME/bin/exports.sh #!/bin/bash LOG=$HOME/log/exports.log logger -t walterh-cronjob Exports started echo Exports started at `date` $LOG rm $HOME/postgresql/* psql packages -f $HOME/sql/exports.sql cd $HOME/postgresql tar cfz postgresql.tgz * rm *csv echo Exports finished at `date` $LOG logger -t walterh-cronjob Exports finished /home/walterh/bin/exports.sh (END) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org I tend to use full path names in my shell scripts. So for shits n giggles, try that. Instead of tar cfz postgresql.tgz * Try /bin/tar cfz postgresql.tgz * etc, etc, etc Use the paths for all commands such as rm, psql, logger etc. -- Keep well, Chris ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Newbie question: Why aren't my cron jobs running?
Walter Hurry walterhu...@gmail.com wrote: As the subject says, this is probably a newbie question (I am new to FreeBSD but quite experienced at Linux). FreeBSD9 on x86_64. Cron is running: $ ps -ax|grep cron 1513 ?? Is 0:00.01 /usr/sbin/cron -s 2283 0 S+ 0:00.00 grep cron $ I have a syntactically valid crontab: 'Syntactically valid', yes, but I believe it does not mean what you think it does applies. more below. $ crontab -l #min hr dom month dow command SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ daddy/bin HOME=/home/walterh 00 02 * * * /home/walterh/exports.sh 05 02 * * * /home/walterh/backup_etc.sh 10 02 * * * /home/walterh/systemcheck.sh 15 02 * * * /home/walterh/backup_bsd.sh $ So what is wrong? Why is nothing happening? I have consulted the handbook but see nothing. It _appears_ that there is whitespace _before_ the purporte 'minutes' value on each line that you intend to invoke a command. If so, -THAT- is probably what is causinng the unexpected behavior. I believe cron is looking for the 'minutes' value _before_ any white space, and using a value of '0' when it finds 'nothing' before the white-space Field-separator. That, thus, the all the commands run at 'zero minutes' past the various hours, on the -second- day of the month, and that command-line that cron would -attempt- to execute on the 2nd looks like, * /home/walterh/systemcheck.sh, which, of course will have *wildly* unexpected results, epecially if the first element of the '*' expansion _is_ marked as executable. Remove the leading white-space and things should work the way you 'expect'. Comment: using a leading zero on the numeric fields is a BAD IDEA(tm) -- you are *strongly* encocuraged to remove them. Yes, that means numbers will not be column aligned, but it is a small price to pay to avoid the hair-tearing that =will= ensue when using it bites you. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Cron Problems
I've recently installed a FreeBSD 9.0 jail server, and inside each of my jails I am getting the following errors in my log about every 5 minutes: cron[7635]: NSSWITCH(_nsdispatch): ldap, group, setgrent, not found, and no fallback provided cron[7635]: NSSWITCH(_nsdispatch): ldap, group, getgrent_r, not found, and no fallback provided cron[7635]: NSSWITCH(_nsdispatch): ldap, group, endgrent, not found, and no fallback provided cron[7635]: NSSWITCH(_nsdispatch): ldap, passwd, endpwent, not found, and no fallback provided /usr/sbin/cron[7673]: (CRON) WARNING (madvise() failed) I'm using nss_ldap and pam_ldap on these systems, so I suspect and error in my /etc/pam.d configuration or my nsswitch.conf configuration. I've added some configuration to /etc/pam.d/sshd and /etc/pam.d/other but have left the other files unmolested. Now, this seems like an nsswitch problem, but my nsswitch.conf is fairly straightforward: group: files ldap hosts: files dns networks: files passwd: files ldap shells: files services: files protocols: files rpc: files I'm able to get user ID information without a problem using id or finger. Authentication is working. LDAP groups are working. Pretty much everything seems like it ought to work, except for those error messages. I don't think this is a PAM issue, but just in case, here's my /etc/pam.d/sshd: authsufficient /usr/local/lib/pam_ldap.so authrequiredpam_unix.so account requiredpam_nologin.so account requiredpam_login_access.so account requiredpam_unix.so session requiredpam_permit.so passwordrequiredpam_unix.so no_warn try_first_pass And here is /etc/pam.d/other: authsufficient /usr/local/lib/pam_ldap.so authrequiredpam_unix.so no_warn try_first_pass account requiredpam_nologin.so account requiredpam_login_access.so account requiredpam_unix.so session requiredpam_permit.so passwordrequiredpam_permit.so I note that there is an /etc/pam.d/cron but it's not clear to me what I might add to this file, as it is quite different than the others: account requiredpam_nologin.so account requiredpam_unix.so So, what am I missing? -- Tim Gustafson t...@tgustafson.com http://tgustafson.com/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Probably working too hard for this cron question
On Mon, 13 Jun 2011, Kurt Buff wrote: Per the handbook, I added SHELL=/bin/sh to crontab, and I also added #!/bin/sh as the first line in the script Should not need both. The first changes a default, which is bad when you switch to another system where that hasn't been changed. The second, putting #!/bin/sh in the script, should be enough. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Probably working too hard for this cron question
All, I've googled a bunch, read some freebsd.org docs, and just can't figure this out. I have a script that should read the current date into a variable, append the time/date stamp at the beginning of the file created with the date in the variable, do a bunch of cURL stuff, then append a time/date stamp at the end of the file. It works if I run it manually, but not from cron. Here are the batchfile and the cron entry: --begin script-- dt=`/bin/date +%Y-%m-%d` /bin/date /root/$dt-external1.txt /usr/local/bin/curl -K /root/urls.txt /root/$dt-external1.txt /bin/date /root/$dt-external1.txt --end script-- --begin crontab-- 15 12 * * */root/do-curl.sh --end crontab-- I'm doing all of this as root, as you can see. The job launches - I can see an entry for cURL in top - but no file in /root. I've tried several variations on the first line of the script, but I'm getting nowhere, though I'm sure it's something stupidly simple that I'm missing. What am I missing? Kurt ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Probably working too hard for this cron question
On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote: All, I've googled a bunch, read some freebsd.org docs, and just can't figure this out. I have a script that should read the current date into a variable, append the time/date stamp at the beginning of the file created with the date in the variable, do a bunch of cURL stuff, then append a time/date stamp at the end of the file. It works if I run it manually, but not from cron. Here are the batchfile and the cron entry: --begin script-- dt=`/bin/date +%Y-%m-%d` /bin/date /root/$dt-external1.txt /usr/local/bin/curl -K /root/urls.txt /root/$dt-external1.txt /bin/date /root/$dt-external1.txt --end script-- --begin crontab-- 15 12 * * * /root/do-curl.sh --end crontab-- I'm doing all of this as root, as you can see. The job launches - I can see an entry for cURL in top - but no file in /root. I've tried several variations on the first line of the script, but I'm getting nowhere, though I'm sure it's something stupidly simple that I'm missing. What am I missing? #!/bin/sh ? -pete -- pete wright www.nycbug.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
RE: Probably working too hard for this cron question
Yeah Pete, kinda need that huh. Kurt, If that turns out to be the only issue, don't feel bad - I've forgotten it myself several times! I'm sure many others have as well! G -Original Message- From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of pete wright Sent: Monday, June 13, 2011 3:25 PM To: Kurt Buff Cc: FreeBSD Questions Subject: Re: Probably working too hard for this cron question On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote: All, I've googled a bunch, read some freebsd.org docs, and just can't figure this out. I have a script that should read the current date into a variable, append the time/date stamp at the beginning of the file created with the date in the variable, do a bunch of cURL stuff, then append a time/date stamp at the end of the file. It works if I run it manually, but not from cron. Here are the batchfile and the cron entry: --begin script-- dt=`/bin/date +%Y-%m-%d` /bin/date /root/$dt-external1.txt /usr/local/bin/curl -K /root/urls.txt /root/$dt-external1.txt /bin/date /root/$dt-external1.txt --end script-- --begin crontab-- 15 12 * * * /root/do-curl.sh --end crontab-- I'm doing all of this as root, as you can see. The job launches - I can see an entry for cURL in top - but no file in /root. I've tried several variations on the first line of the script, but I'm getting nowhere, though I'm sure it's something stupidly simple that I'm missing. What am I missing? #!/bin/sh ? -pete -- pete wright www.nycbug.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org font size=1 div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in' /div This email is intended to be reviewed by only the intended recipient and may contain information that is privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any review, use, dissemination, disclosure or copying of this email and its attachments, if any, is strictly prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system. /font ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Probably working too hard for this cron question
On Mon, Jun 13, 2011 at 2:14 PM, Gary Gatten ggat...@waddell.com wrote: Yeah Pete, kinda need that huh. Kurt, If that turns out to be the only issue, don't feel bad - I've forgotten it myself several times! I'm sure many others have as well! as someone who was fixing some brain dead cron entries he setup on friday this morning...i agree :^) -pete -- pete wright www.nycbug.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Probably working too hard for this cron question
On Mon, Jun 13, 2011 at 13:25, pete wright nomadlo...@gmail.com wrote: On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote: All, I've googled a bunch, read some freebsd.org docs, and just can't figure this out. I have a script that should read the current date into a variable, append the time/date stamp at the beginning of the file created with the date in the variable, do a bunch of cURL stuff, then append a time/date stamp at the end of the file. It works if I run it manually, but not from cron. Here are the batchfile and the cron entry: --begin script-- dt=`/bin/date +%Y-%m-%d` /bin/date /root/$dt-external1.txt /usr/local/bin/curl -K /root/urls.txt /root/$dt-external1.txt /bin/date /root/$dt-external1.txt --end script-- --begin crontab-- 15 12 * * * /root/do-curl.sh --end crontab-- I'm doing all of this as root, as you can see. The job launches - I can see an entry for cURL in top - but no file in /root. I've tried several variations on the first line of the script, but I'm getting nowhere, though I'm sure it's something stupidly simple that I'm missing. What am I missing? #!/bin/sh ? Definitely closer... Per the handbook, I added SHELL=/bin/sh to crontab, and I also added #!/bin/sh as the first line in the script But, while a file is being created, it's just /root/-external1.txt not /root/2011-06-13-external1.txt Kurt ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Probably working too hard for this cron question
Indeed. Brain fade comes with age - and long weekends with the 2 year old boy... Kurt On Mon, Jun 13, 2011 at 14:14, Gary Gatten ggat...@waddell.com wrote: Yeah Pete, kinda need that huh. Kurt, If that turns out to be the only issue, don't feel bad - I've forgotten it myself several times! I'm sure many others have as well! G -Original Message- From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-questi...@freebsd.org] On Behalf Of pete wright Sent: Monday, June 13, 2011 3:25 PM To: Kurt Buff Cc: FreeBSD Questions Subject: Re: Probably working too hard for this cron question On Mon, Jun 13, 2011 at 12:52 PM, Kurt Buff kurt.b...@gmail.com wrote: All, I've googled a bunch, read some freebsd.org docs, and just can't figure this out. I have a script that should read the current date into a variable, append the time/date stamp at the beginning of the file created with the date in the variable, do a bunch of cURL stuff, then append a time/date stamp at the end of the file. It works if I run it manually, but not from cron. Here are the batchfile and the cron entry: --begin script-- dt=`/bin/date +%Y-%m-%d` /bin/date /root/$dt-external1.txt /usr/local/bin/curl -K /root/urls.txt /root/$dt-external1.txt /bin/date /root/$dt-external1.txt --end script-- --begin crontab-- 15 12 * * * /root/do-curl.sh --end crontab-- I'm doing all of this as root, as you can see. The job launches - I can see an entry for cURL in top - but no file in /root. I've tried several variations on the first line of the script, but I'm getting nowhere, though I'm sure it's something stupidly simple that I'm missing. What am I missing? #!/bin/sh ? -pete -- pete wright www.nycbug.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org font size=1 div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in' /div This email is intended to be reviewed by only the intended recipient and may contain information that is privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any review, use, dissemination, disclosure or copying of this email and its attachments, if any, is strictly prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system. /font ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Fetching distfiles via cron does not download...
Hello list. I have the following in /etc/crontab @reboot root portsnap -I cron update /root/bin/cv_portsnap_cron pkg_version -vIL= The script /root/bin/cv_portsnap_cron #!/bin/sh portmaster --clean-distfiles-all portmaster -aF Message received from cron: === Gathering distinfo list for installed ports === Checking for stale distfiles ]0;portmaster: All=== Starting check of installed ports for available updates === Distfile fetching is complete libxul-1.9.2.9_1 needs updating (index has 1.9.2.12) pciids-20101005needs updating (index has 20101020) Even so I do not get the distfiles downloaded. Where am I going wrong? Thanks /Leslie ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Fetching distfiles via cron does not download...
On Tue, Nov 2, 2010 at 4:08 AM, Leslie Jensen les...@eskk.nu wrote: Hello list. I have the following in /etc/crontab @reboot root portsnap -I cron update /root/bin/cv_portsnap_cron pkg_version -vIL= I don't see where you are doing a portsnap fetch first. If you haven't done a fetch, then the update will probably fail. If the update fails, because you are using it won't execute the next part of your script. The script /root/bin/cv_portsnap_cron #!/bin/sh portmaster --clean-distfiles-all portmaster -aF Message received from cron: === Gathering distinfo list for installed ports === Checking for stale distfiles ]0;portmaster: All === Starting check of installed ports for available updates === Distfile fetching is complete libxul-1.9.2.9_1 needs updating (index has 1.9.2.12) pciids-20101005needs updating (index has 20101020) Even so I do not get the distfiles downloaded. Where am I going wrong? Thanks /Leslie ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org -- -- Lystic http://UnixNews.net ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Fetching distfiles via cron does not download...
Lystic Emsen skrev 2010-11-02 11:53: On Tue, Nov 2, 2010 at 4:08 AM, Leslie Jensenles...@eskk.nu wrote: Hello list. I have the following in /etc/crontab @reboot root portsnap -I cron update /root/bin/cv_portsnap_cron pkg_version -vIL= I don't see where you are doing a portsnap fetch first. If you haven't done a fetch, then the update will probably fail. If the update fails, because you are using it won't execute the next part of your script. According to the handbook this command is supposed to do that. portsnap -I cron update /Leslie The script /root/bin/cv_portsnap_cron #!/bin/sh portmaster --clean-distfiles-all portmaster -aF Message received from cron: === Gathering distinfo list for installed ports === Checking for stale distfiles ]0;portmaster: All === Starting check of installed ports for available updates === Distfile fetching is complete libxul-1.9.2.9_1needs updating (index has 1.9.2.12) pciids-20101005needs updating (index has 20101020) Even so I do not get the distfiles downloaded. Where am I going wrong? Thanks /Leslie ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Fetching distfiles via cron does not download...
On Tue, Nov 2, 2010 at 5:57 AM, Leslie Jensen les...@eskk.nu wrote: Lystic Emsen skrev 2010-11-02 11:53: On Tue, Nov 2, 2010 at 4:08 AM, Leslie Jensenles...@eskk.nu wrote: Hello list. I have the following in /etc/crontab @reboot root portsnap -I cron update /root/bin/cv_portsnap_cron pkg_version -vIL= I don't see where you are doing a portsnap fetch first. If you haven't done a fetch, then the update will probably fail. If the update fails, because you are using it won't execute the next part of your script. According to the handbook this command is supposed to do that. portsnap -I cron update Yeah, you are right, I missed that. However, the problem is that you didn't specify the full path to portsnap. That will cause it to fail and the operator won't let it proceed. When using cron, you need to specify the full path because cron doesn't have access to all the environment variables your normal shell does. -- Lystic http://UnixNews.net http://unixnews.net/ /Leslie The script /root/bin/cv_portsnap_cron #!/bin/sh portmaster --clean-distfiles-all portmaster -aF Message received from cron: === Gathering distinfo list for installed ports === Checking for stale distfiles ]0;portmaster: All === Starting check of installed ports for available updates === Distfile fetching is complete libxul-1.9.2.9_1needs updating (index has 1.9.2.12) pciids-20101005needs updating (index has 20101020) Even so I do not get the distfiles downloaded. Where am I going wrong? Thanks /Leslie ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org -- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Fetching distfiles via cron does not download...
Lystic Emsen skrev 2010-11-02 12:44: According to the handbook this command is supposed to do that. portsnap -I cron update Yeah, you are right, I missed that. However, the problem is that you didn't specify the full path to portsnap. That will cause it to fail and the operator won't let it proceed. When using cron, you need to specify the full path because cron doesn't have access to all the environment variables your normal shell does. -- Lystic http://UnixNews.nethttp://unixnews.net/ If what you say is correct then I shouldn't get the result of pkg_version -vIL telling me that there are ports that need an upgrade, should I? /Leslie ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: 8.1: Cron ignoring crontab updates
Arthur Chance free...@qeng-ho.org wrote: On 09/03/10 09:19, per...@pluto.rain.com wrote: Chris Reesutis...@gmail.com wrote: You have to SIGHUP cron, not restart it. # killall -HUP cron Isn't crontab(1) supposed to do that, without separate intervention? From man cron Additionally, cron checks each minute to see if its spool directory's modification time (or the modification time on /etc/crontab) has changed, and if it has, cron will then examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modification time of the spool directory whenever it changes a crontab. OK, I had the mechanism wrong. The main point is, it should not require manual intervention by an administrator to get cron(8) to notice when crontab(1) has revised a crontab. The one thing I can think of, short of a bug, is that a change made less than 1 minute before the newly-added or -removed event might not be noticed in time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: 8.1: Cron ignoring crontab updates
Chris Rees utis...@gmail.com wrote: You have to SIGHUP cron, not restart it. # killall -HUP cron Isn't crontab(1) supposed to do that, without separate intervention? On 2 Sep 2010 21:11, patrick gibblert...@gmail.com wrote: I recently upgraded a FreeBSD 7.0 system to 8.1-RELEASE (via freebsd-update) and am experiencing the strangest cron problem I have ever seen. My cron jobs run, but if I make any changes to my crontab, cron does not pick them up; it continues to operate based on the snapshot of crontabs it loaded when cron was started up ... Has anyone come across this? Yes, so long ago I no longer remember which Unix flavor it was on. Could have been SunOs 3.5 or 4.x, some version of Solaris, UnixWare, or even FreeBSD 4.x. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: 8.1: Cron ignoring crontab updates
On 09/03/10 09:19, per...@pluto.rain.com wrote: Chris Reesutis...@gmail.com wrote: You have to SIGHUP cron, not restart it. # killall -HUP cron Isn't crontab(1) supposed to do that, without separate intervention? From man cron Additionally, cron checks each minute to see if its spool directory's modification time (or the modification time on /etc/crontab) has changed, and if it has, cron will then examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modification time of the spool directory whenever it changes a crontab. From the original post crontab seems to be working, so all I can suggest is to ls -ld /var/cron/tabs before and after using crontab -e and see if the modtime is being changed correctly. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: 8.1: Cron ignoring crontab updates
Yes, it's definitely updating: [r...@juno /var/cron/tabs]# ls -ald /var/cron/tabs drwx-- 2 root wheel 512 Sep 2 12:49 /var/cron/tabs And after editing my crontab: [r...@juno /var/cron/tabs]# ls -ald /var/cron/tabs drwx-- 2 root wheel 512 Sep 3 10:25 /var/cron/tabs I've been using FreeBSD since version 4, and this has never once been an issue, nor is this an issue on a system with a fresh install of 8.1. Patrick On Fri, Sep 3, 2010 at 2:37 AM, Arthur Chance free...@qeng-ho.org wrote: On 09/03/10 09:19, per...@pluto.rain.com wrote: Chris Reesutis...@gmail.com wrote: You have to SIGHUP cron, not restart it. # killall -HUP cron Isn't crontab(1) supposed to do that, without separate intervention? From man cron Additionally, cron checks each minute to see if its spool directory's modification time (or the modification time on /etc/crontab) has changed, and if it has, cron will then examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modification time of the spool directory whenever it changes a crontab. From the original post crontab seems to be working, so all I can suggest is to ls -ld /var/cron/tabs before and after using crontab -e and see if the modtime is being changed correctly. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: 8.1: Cron ignoring crontab updates
You have to SIGHUP cron, not restart it. # killall -HUP cron Chris Sorry for top-posting, Android won't let me quote, but K-9 can't yet do threading. On 2 Sep 2010 21:11, patrick gibblert...@gmail.com wrote: I recently upgraded a FreeBSD 7.0 system to 8.1-RELEASE (via freebsd-update) and am experiencing the strangest cron problem I have ever seen. My cron jobs run, but if I make any changes to my crontab, cron does not pick them up; it continues to operate based on the snapshot of crontabs it loaded when cron was started up. If I restart cron (/etc/rc.d/cron restart), the changes are then picked up, but again, any subsequent changes are ignored. I don't see any issues with the permissions, and when I edit a crontab, it says crontab: installing new crontab, and the /var/log/cron log shows BEGIN EDIT, REPLACE, and END EDIT. I'm somewhat at a loss to figure out where the disconnect is, and it's impractical for me to have to restart cron any time any user updates their crontab. Has anyone come across this? Patrick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Cron problems
On Sat, Aug 28, 2010 at 01:49:18PM +0200, Bernt Hansson wrote: Hell Bernt, I'm having problems with lines like this in cron, works on the command line, but not in cron. /sbin/dump -0uan -f - /usr | gzip -2 | ssh -c blowfish \ targetu...@targetmachine.example.com dd of=/mybigfiles/dump-usr-l0-`date +%Y-%m-%d--%H-%M-%S`.gz you need to escape the percent-signs like that: \% For why see man 5 crontab Regards Thomas ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Simulate CRON
I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. I hope I am explaining this sanely enough. -- Carmel ✌ carmel...@hotmail.com |=== |=== |=== |=== | THE DAILY PLANET SUPERMAN SAVES DESSERT! Plans to Eat it later ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
On Mon, Jun 14, 2010 at 3:42 PM, Carmel carmel...@hotmail.com wrote: I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. I hope I am explaining this sanely enough. -- Carmel ✌ carmel...@hotmail.com Are you looking for a cron syntax check? If yes, then this site should be of some help: http://www.hxpi.com/cron_sandbox.php Amitabh ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
On Mon, 14 Jun 2010 16:41:19 +0530 Amitabh Kant amitabhk...@gmail.com articulated: On Mon, Jun 14, 2010 at 3:42 PM, Carmel carmel...@hotmail.com wrote: I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. I hope I am explaining this sanely enough. Are you looking for a cron syntax check? If yes, then this site should be of some help: http://www.hxpi.com/cron_sandbox.php No, sorry. There was a command or program, I forgot which, that would allow a user to run a program under another environment, similar to the environment that a script under CRON would be running under. -- Carmel ✌ carmel...@hotmail.com |=== |=== |=== |=== | We're living in a golden age. All you need is gold. D. W. Robertson ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
Carmel writes: I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. Are you looking for a cron syntax check? If yes, then this site should be of some help: No, sorry. There was a command or program, I forgot which, that would allow a user to run a program under another environment, similar to the environment that a script under CRON would be running under. Are you possibly talking about a jail? Robert Huff ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
On Mon, Jun 14, 2010 at 1:39 PM, Carmel carmel...@hotmail.com wrote: No, sorry. There was a command or program, I forgot which, that would allow a user to run a program under another environment, similar to the environment that a script under CRON would be running under. at(1) maybe? -cpghost. -- Cordula's Web. http://www.cordula.ws/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14/06/2010 12:55:34, Robert Huff wrote: Carmel writes: I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. Are you looking for a cron syntax check? If yes, then this site should be of some help: No, sorry. There was a command or program, I forgot which, that would allow a user to run a program under another environment, similar to the environment that a script under CRON would be running under. Are you possibly talking about a jail? Try: env -i USER=$USER HOME=$HOME LOGNAME=$LOGNAME \ PATH=/usr/bin:/bin SHELL=/bin/sh PWD=$HOME your-script-name Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matt...@infracaninophile.co.uk Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwWHPQACgkQ8Mjk52CukIx5fQCaAlvxOIEvdG96J1+lSB0UCQlX NqsAnjFA4gG6eJtPiHlIBcfdRzjxaSAB =AwPN -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
On Monday 14 June 2010 13:39:15 Carmel wrote: On Mon, 14 Jun 2010 16:41:19 +0530 Amitabh Kant amitabhk...@gmail.com articulated: On Mon, Jun 14, 2010 at 3:42 PM, Carmel carmel...@hotmail.com wrote: I saw a posting here months ago regarding a way to simulate running a script under CRON. I wrote it down and now cannot find it. Googling has not proved very useful either. I just cannot remember the program name. I hope I am explaining this sanely enough. Are you looking for a cron syntax check? If yes, then this site should be of some help: http://www.hxpi.com/cron_sandbox.php No, sorry. There was a command or program, I forgot which, that would allow a user to run a program under another environment, similar to the environment that a script under CRON would be running under. env(1)? From the manpage: The env utility executes another utility after modifying the environment as specified on the command line. Jonathan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Simulate CRON
On Mon, 14 Jun 2010 07:55:34 -0400 Robert Huff roberth...@rcn.com articulated: Are you possibly talking about a jail? Sorry, no. I am going to try searching the questions archives and perhaps come up with it. -- Carmel ✌ carmel...@hotmail.com |=== |=== |=== |=== | Carson's Consolation: Nothing is ever a complete failure. It can always be used as a bad example. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails (SOLVED)
I Had a terrible week with freebsd. In monday I did an upgrade from 7.3 to 8.1-prerelease in 3 machines, 2 of them worked normaly and one stop functioning, and without user (ldap) e cron is not sending emails. The log for cron is: Jun 10 19:45:00 sol /usr/sbin/cron[80892]: (root) CMD (/usr/libexec/atrun) Jun 10 19:45:00 sol cron[80892]: NSSWITCH(_nsdispatch): ldap, group, setgrent, not found, and no fallback provided Jun 10 19:45:00 sol cron[80891]: NSSWITCH(_nsdispatch): ldap, group, setgrent, not found, and no fallback provided Jun 10 19:45:00 sol cron[80892]: NSSWITCH(_nsdispatch): ldap, group, getgrent_r, not found, and no fallback provided Jun 10 19:45:00 sol cron[80891]: NSSWITCH(_nsdispatch): ldap, group, getgrent_r, not found, and no fallback provided Jun 10 19:45:00 sol cron[80892]: NSSWITCH(_nsdispatch): ldap, group, endgrent, not found, and no fallback provided Jun 10 19:45:00 sol cron[80891]: NSSWITCH(_nsdispatch): ldap, group, endgrent, not found, and no fallback provided Jun 10 19:45:00 sol cron[80891]: NSSWITCH(_nsdispatch): ldap, passwd, endpwent, not found, and no fallback provided Jun 10 19:45:00 sol cron[80892]: NSSWITCH(_nsdispatch): ldap, passwd, endpwent, not found, and no fallback provided The ldap stop working with the messages: Jun 10 17:25:09 sol slapd[41741]: @(#) $OpenLDAP: slapd 2.3.43 (Jun 10 2010 17:16:31) $ r...@sol.cnptia.embrapa.br:/usr/ports/net/openldap23-server/work/openldap-2.3.43/servers/slapd Jun 10 17:25:09 sol slapd[41741]: NSSWITCH(_nsdispatch): ldap, passwd, endpwent, not found, and no fallback provided Jun 10 17:25:09 sol slapd[41741]: NSSWITCH(_nsdispatch): ldap, group, setgrent, not found, and no fallback provided Jun 10 17:25:09 sol slapd[41741]: NSSWITCH(_nsdispatch): ldap, group, getgrent_r, not found, and no fallback provided Jun 10 17:25:09 sol slapd[41741]: NSSWITCH(_nsdispatch): ldap, group, endgrent, not found, and no fallback provided Jun 10 17:25:09 sol slapd[41741]: NSSWITCH(_nsdispatch): ldap, group, endgrent, not found, and no fallback provided Jun 10 17:25:09 sol slapd[41742]: slapd starting and in auth.log this log Jun 7 19:22:17 sol login: pam_acct_mgmt(): error in service module And until today after recompiling everithing from the ports to the system I cannot find the error. Today I found this: rigel# ldd /usr/local/lib/nss_ldap.so.1 /usr/local/lib/nss_ldap.so.1: libldap-2.3.so.2 = /usr/local/lib/libldap-2.3.so.2 (0x800c0) liblber-2.3.so.2 = /usr/local/lib/liblber-2.3.so.2 (0x800d37000) libsasl2.so.2 = /usr/local/lib/libsasl2.so.2 (0x800e45000) libkrb5.so.10 = /usr/lib/libkrb5.so.10 (0x800f5d000) libcom_err.so.5 = /usr/lib/libcom_err.so.5 (0x8010ca000) libgssapi_krb5.so.10 = /usr/lib/libgssapi_krb5.so.10 (0x8011cc000) libc.so.6 =(unknow) libssl.so.6 = /usr/lib/libssl.so.6 (0x8012e6000) libcrypto.so.6 = /lib/libcrypto.so.6 (0x801438000) libgssapi.so.10 = /usr/lib/libgssapi.so.10 (0x8016d2000) libhx509.so.10 = /usr/lib/libhx509.so.10 (0x8017db000) libroken.so.10 = /usr/lib/libroken.so.10 (0x80191a000) libasn1.so.10 = /usr/lib/libasn1.so.10 (0x801a2b000) libcrypt.so.5 = /lib/libcrypt.so.5 (0x801baa000) The problem was the libsasl2 (cyrus-sasl2) that was old. I found a lot of pages in google with this problem and no solution. And I find it using the command cd /usr/local/lib ; grep -R libc.so.6 *. After the finding I compiled the module (cyrus-sals2) and everything comes back to normal. The problem is that nss_ldap.so.1 dont say that the library is missing but point the error to the PAM modules. Everyone that have this same problem try to find in the nss_ldap, pam_ldap etc, some reference to old libs. Paniago ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
Cron is still not sending emails. Any idea? Is there any output in the 'maillog' log? May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
It doesn't work. With, or without the MAILTO. Just for completeness, I have used this: MAILTO=gandalf The gandalf user is a local user on the system. I can send local mail to this user using the sendmail postfix program (checked twice). Cron is still not sending emails. Any idea? Yes, check the log of cron (/var/log/cron) if you job is run at all; if so check the log of mails (/var/log/maillog). Cron jobs are started. Just their output are not sent in emails. The output of the maillog I already sent before: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header Btw: what is the purpose of putting TEST into ? I tend to use double quotes for command line parameters. This is just a habit that I use it even when it is not really necessary. Output from /var/log/cron follows Jun 1 04:55:00 shopzeus /usr/sbin/cron[89378]: (tmp.27734) ORPHAN (no passwd entry) Jun 1 04:55:00 shopzeus /usr/sbin/cron[89378]: (root) RELOAD (tabs/root) Jun 1 04:55:00 shopzeus /usr/sbin/cron[89378]: NSSWITCH(_nsdispatch): nis, passwd_compat, endpwent, not found, and no fallback provided Jun 1 04:55:00 shopzeus /usr/sbin/cron[27073]: (operator) CMD (/usr/libexec/save-entropy) Jun 1 04:55:00 shopzeus /usr/sbin/cron[27075]: (root) CMD (/usr/libexec/atrun) Jun 1 04:55:00 shopzeus cron[27075]: NSSWITCH(_nsdispatch): nis, passwd_compat, endpwent, not found, and no fallback provided Jun 1 04:55:00 shopzeus /usr/sbin/cron[27082]: (root) CMD (echo Test) (Followed by other similar rows with NSSWITCH and CMD.) Thanks Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
2010/5/28 Laszlo Nagy gand...@shopzeus.com: Hi All! After upgrading to 8.0 RELEASE, I'm not getting any emails from cron. If I put this into root's crontab * * * * * echo TEST then I see this in the maillog: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header Just as a side note, I started having this problem a while ago with 7.2-RELEASE, I believe. I was using the base-system sendmail and no special configuration with cron or anything. I never found a solution. I posted on this mailing list and nothing anyone suggested solved it. I ended up just piping every single cron command into /usr/bin/mail: 0 */4 * * * root /usr/local/backups/daily_backup.sh | /usr/bin/mail -E -s Daily Backup em...@address.tld That works fine. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
El día Tuesday, June 01, 2010 a las 09:41:11AM -0400, APseudoUtopia escribió: 2010/5/28 Laszlo Nagy gand...@shopzeus.com: Hi All! After upgrading to 8.0 RELEASE, I'm not getting any emails from cron. If I put this into root's crontab * * * * * echo TEST then I see this in the maillog: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header Just as a side note, I started having this problem a while ago with 7.2-RELEASE, I believe. I was using the base-system sendmail and no special configuration with cron or anything. I never found a solution. I posted on this mailing list and nothing anyone suggested solved it. I ended up just piping every single cron command into /usr/bin/mail: 0 */4 * * * root /usr/local/backups/daily_backup.sh | /usr/bin/mail -E -s Daily Backup em...@address.tld That works fine. current# uname -a FreeBSD current.unixarea.de 8.0-CURRENT FreeBSD 8.0-CURRENT #5: Sun Jan 10 09:55:14 CET 2010 g...@current.unixarea.de:/usr/obj/usr/src/sys/GENERIC i386 current# crontab -l | fgrep 15 56 15 * * * /usr/sbin/ntpdate -b ntps1-0.cs.tu-berlin.de current# tail -3 /var/log/cron Jun 1 15:56:00 current /usr/sbin/cron[1509]: (root) RELOAD (tabs/root) Jun 1 15:56:00 current /usr/sbin/cron[8209]: (root) CMD (/usr/sbin/ntpdate -b ntps1-0.cs.tu-berlin.de) Jun 1 15:57:17 current crontab[8220]: (root) LIST (root) current# tail /var/log/maillog Jun 1 15:56:01 current sm-mta[8213]: o51Du1q1008212: to=r...@current.unixarea.de, ctladdr=r...@current.unixarea.de (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30877, relay=local, dsn=2.0.0, stat=Sent i.e. no problem on my system; matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e g...@unixarea.de - w http://www.unixarea.de/ Solidarity with the zionistic pirates of Israel? Not in my name! ¿Solidaridad con los piratas sionistas de Israel? ¡No en mi nombre! ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
If I put this into root's crontab * * * * * echo TEST a quick guess, you have a line like: MAILTO=address It doesn't work. With, or without the MAILTO. Just for completeness, I have used this: MAILTO=gandalf The gandalf user is a local user on the system. I can send local mail to this user using the sendmail postfix program (checked twice). Cron is still not sending emails. Any idea? Thanks Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
On Sun, 30 May 2010 17:21:20 +0200 Laszlo Nagy gand...@shopzeus.com articulated: Cron is still not sending emails. Any idea? Is there any output in the 'maillog' log? -- Jerry freebsd.u...@seibercom.net Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
El día Sunday, May 30, 2010 a las 05:21:20PM +0200, Laszlo Nagy escribió: If I put this into root's crontab * * * * * echo TEST a quick guess, you have a line like: MAILTO=address It doesn't work. With, or without the MAILTO. Just for completeness, I have used this: MAILTO=gandalf The gandalf user is a local user on the system. I can send local mail to this user using the sendmail postfix program (checked twice). Cron is still not sending emails. Any idea? Yes, check the log of cron (/var/log/cron) if you job is run at all; if so check the log of mails (/var/log/maillog). Btw: what is the purpose of putting TEST into ? matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e g...@unixarea.de - w http://www.unixarea.de/ ¡Ya basta! ¡Tropas de OTAN, fuera de Afghanistan! There's an end of it! NATO troups out of Afghanistan! Schluss jetzt endlich! NATO raus aus Afghanistan! ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
cron not sending emails
Hi All! After upgrading to 8.0 RELEASE, I'm not getting any emails from cron. If I put this into root's crontab * * * * * echo TEST then I see this in the maillog: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header I'm using postfix. Sendmail config looks fine: A /etc/mail/mailer.conf -ban ez van: # # Execute the Postfix sendmail program, named /usr/local/sbin/sendmail # sendmail/usr/local/sbin/sendmail send-mail/usr/local/sbin/sendmail mailq/usr/local/sbin/sendmail newaliases/usr/local/sbin/sendmail I tried to run cron -x: # cron -x bit,ext,load,misc,pars,proc,sch cron.log debug flags enabled: ext sch proc pars load misc bit [92380] cron started log_it: (tmp.27734 92380) ORPHAN (no passwd entry) log_it: (root 92429) CMD (echo Test) ^C The cron.log file itself is very very long (there are many programs and user configs). I'll paste the relevant parts only: root:load_user() load_env, read MAILTO=gandalf load_env, MAILTO gandalf - MAILTO=gandalf load_env, read SHELL=/bin/sh load_env, SHELL /bin/sh - SHELL=/bin/sh load_env, read PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin load_env, PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin - PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin load_env, read * * * * * echo Test load_env, parse error, state = 7 load_entry()...about to eat comments load_entry()...about to parse numerics load_entry()...about to parse command load_entry()...returning successfully ...load_user() done [done] At the end of the file: [2400] checking account with PAM [2401] grandchild process Vfork()'ed [2402] grandchild process Vfork()'ed [2403] grandchild process Vfork()'ed [2404] grandchild process Vfork()'ed [2405] grandchild process Vfork()'ed [2395] child continues, closing pipes [2395] child reading output from grandchild [2406] grandchild process Vfork()'ed [2396] child continues, closing pipes [2396] child reading output from grandchild [2397] child continues, closing pipes [2397] child reading output from grandchild [2398] child continues, closing pipes [2398] child reading output from grandchild [2399] child continues, closing pipes [2399] child reading output from grandchild [2400] child continues, closing pipes [2400] child reading output from grandchild [2395] closing pipe to mail [2331] sigchld...pid #2395 died, stat=0 [2331] sigchld...no dead kids [2331] TargetTime=1275040320, sec-to-wait=60 [2331] sleeping for 60 seconds [2399] got EOF from grandchild [2399] waiting for grandchild #2 to finish [2399] grandchild #2404 finished, status= [2399] waiting for grandchild #1 to finish [2399] no more grandchildren--mail written? [2399] child process done, exiting [2331] sigchld...pid #2399 died, stat=0 [2331] sigchld...no dead kids [2331] TargetTime=1275040320, sec-to-wait=60 [2331] sleeping for 60 seconds [2398] got EOF from grandchild [2398] waiting for grandchild #2 to finish [2398] grandchild #2405 finished, status= [2398] waiting for grandchild #1 to finish [2398] no more grandchildren--mail written? [2398] child process done, exiting [2331] sigchld...pid #2398 died, stat=0 [2331] sigchld...no dead kids [2331] TargetTime=1275040320, sec-to-wait=60 [2331] sleeping for 60 seconds [2397] got EOF from grandchild [2397] waiting for grandchild #2 to finish [2397] grandchild #2403 finished, status= [2397] waiting for grandchild #1 to finish [2397] no more grandchildren--mail written? [2397] child process done, exiting [2331] sigchld...pid #2397 died, stat=0 [2331] sigchld...no dead kids [2331] TargetTime=1275040320, sec-to-wait=59 [2331] sleeping for 59 seconds So, what is wrong? Thanks, Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
Hi-- On May 28, 2010, at 4:42 AM, Laszlo Nagy wrote: If I put this into root's crontab * * * * * echo TEST then I see this in the maillog: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header These do not correspond. It seems to think that the crontab is for uid 1001, but it can't seem to lookup a passwd entry for that uid: log_it: (tmp.27734 92380) ORPHAN (no passwd entry) -- -Chuck ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
Chuck Swiger írta: Hi-- On May 28, 2010, at 4:42 AM, Laszlo Nagy wrote: If I put this into root's crontab * * * * * echo TEST then I see this in the maillog: May 14 10:53:00 server postfix/sendmail[2958]: fatal: user(1001): No recipient addresses found in message header These do not correspond. I can assure you, that the maillog DOES correspond to the cron job. E.g. if I add two jobs for the same point in time, then two new lines will appear in the maillog, at exactly the given time. If I remove them, then no line will show up etc. It seems to think that the crontab is for uid 1001, but it can't seem to lookup a passwd entry for that uid: log_it: (tmp.27734 92380) ORPHAN (no passwd entry) Well, actually it is not just user=1001. Many users have crontabs on this system. I cannot tell which one is orphaned. (Maybe munin? That was removed recently from the system...) Actually, user 1001 does have a password entry. So do others, and their crontabs are working. Programs are started by cron, but their output is lost. L ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
Am 28.05.10 13:42, schrieb Laszlo Nagy: If I put this into root's crontab * * * * * echo TEST a quick guess, you have a line like: MAILTO=address Bye, Matthias -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning. -- Rich Cook ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron not sending emails
Matthias Fechner írta: Am 28.05.10 13:42, schrieb Laszlo Nagy: If I put this into root's crontab * * * * * echo TEST a quick guess, you have a line like: MAILTO=address Bye, Matthias It doesn't work. With, or without the MAILTO. Just for completeness, I have used this: MAILTO=gandalf The gandalf user is a local user on the system. I can send local mail to this user using the sendmail postfix program (checked twice). Best, Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
RE: Kill via Cron...
kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` And you don't have to remember grep -v grep if you remember to use ps axc (note the c), since arguments won't show up so the arguments to grep won't generate a false positive. I'm actually trying to kill the following in one swep if they've taken more than 8 hours to complete... : 39028 ?? Is 0:00.01 /bin/sh -c sh /root/tools/backup/fullbackup.sh 39070 ?? I 0:00.04 /usr/bin/perl /root/tools/backup/backuptodisk.pl (perl5.8.9) 62219 ?? I 0:00.00 sh -c /sbin/dump -0 -auf - /usr | gzip -q /backup/wednesday/usr.dump.gz 62220 ?? I 0:00.33 /sbin/dump -0 -auf - /usr (dump) 62221 ?? S 0:27.11 gzip -q 6 ?? S 0:03.07 dump: /dev/da0s1e: pass 4: 3.82% done, finished in 1:09 at Wed Apr 21 09:48:59 2010 (dump) 62223 ?? DL 0:01.80 /sbin/dump -0 -auf - /usr (dump) 62224 ?? DL 0:01.79 /sbin/dump -0 -auf - /usr (dump) 62225 ?? DL 0:01.81 /sbin/dump -0 -auf - /usr (dump) Have tried everything suggested thus far but nothing's done it as effectively as the original command run at commandline... just trying to automate the process by having cron kill at 8am. Cheers! Marci ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21/04/2010 09:36:24, mcoyles wrote: I'm actually trying to kill the following in one swep if they've taken more than 8 hours to complete... : 39028 ?? Is 0:00.01 /bin/sh -c sh /root/tools/backup/fullbackup.sh 39070 ?? I 0:00.04 /usr/bin/perl /root/tools/backup/backuptodisk.pl (perl5.8.9) 62219 ?? I 0:00.00 sh -c /sbin/dump -0 -auf - /usr | gzip -q /backup/wednesday/usr.dump.gz 62220 ?? I 0:00.33 /sbin/dump -0 -auf - /usr (dump) 62221 ?? S 0:27.11 gzip -q 6 ?? S 0:03.07 dump: /dev/da0s1e: pass 4: 3.82% done, finished in 1:09 at Wed Apr 21 09:48:59 2010 (dump) 62223 ?? DL 0:01.80 /sbin/dump -0 -auf - /usr (dump) 62224 ?? DL 0:01.79 /sbin/dump -0 -auf - /usr (dump) 62225 ?? DL 0:01.81 /sbin/dump -0 -auf - /usr (dump) Have tried everything suggested thus far but nothing's done it as effectively as the original command run at commandline... just trying to automate the process by having cron kill at 8am. Hmmm is that because the system needs the resources for its usual functions after 8am? Or because if it hasn't finished by that time, it is clearly hung up and never going to finish? In the first case, I'd suggest simply running the backup at very low priority by renicing it to a high value -- it will run at usual speed *unless* there is anything else that wants a CPU timeslice, when it will be made to wait. In the second case, fixing whatever is causing the hang would be a better idea. (Processes that are hung up trying to do IO may not respond to signals very promptly which could explain some of your difficulties.) Unless you've got literally terabytes of content or are trying to write to a ridiculously slow device, and assuming you start the backup process at midnight, 8h is more than enough to backup most hard drives. Is your /backup partition on the *same* disk you're backing up? Or perhaps /backup is on the slave and /usr is on the master of the same IDE bus? Either of those could cause significant IO congestion. Other things to check for are filesystem corruption -- you'll need to take the machine down to single user, unmount the partitions in question and run fsck(8) on them -- or hardware problems - -- check the system log for any reports of trouble, try installing smartd and see if it tells you anything interesting. If your disk is flaking out, then don't try and coddle it along: replace it ASAP. Once things have got to the state where errors are affecting the OS, for any modern drive that indicates complete failure is imminent. Cheers, Matthew PS. You'll get better results if you add -L -C 32 to the dump(1) command line. Should speed things up nicely as well. - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvOxokACgkQ8Mjk52CukIzwXACggmDSc35Y+r936agwCuihzghT tIgAmgLemFna0dbuhRsJau5QAQ1lnvo0 =vKgz -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
On 21/04/2010 09:36:24, mcoyles wrote: M I'm actually trying to kill the following in one swep if they've taken M more than 8 hours to complete... : M 62221 ?? S 0:27.11 gzip -q M 62223 ?? DL 0:01.80 /sbin/dump -0 -auf - /usr (dump) M 62224 ?? DL 0:01.79 /sbin/dump -0 -auf - /usr (dump) M 62225 ?? DL 0:01.81 /sbin/dump -0 -auf - /usr (dump) If they're running under the same process groupid, then sending it a signal via killpg(2) would kill them all. Two things that might help: * The default blocksize (Kb/output block) in dump used to be 10, but you could go as high as 64. Check the -b option. * Use gzip -1q for speed at the cost of slightly less compression. compress -c also works very well on dump images, and it's fast. -- Karl Vogel I don't speak for the USAF or my company phrasemonger, noun: a person who uses phrases or quotes that were coined by other people. --http://www.wordspy.com/TechWordSpy/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Kill via Cron...
Morning all - on FreeBSD 7.1 (for various reasons - don't ask) Am attempting to run the following via cron but it keeps erroring out: kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` kill -9 `ps ax | grep dump | grep -v grep | awk '{print $1}'` Error: usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... Works OK from commandline - what do I need to change to make this cronable?? Cheers Marci ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20/04/2010 08:52:58, mcoyles wrote: Morning all - on FreeBSD 7.1 (for various reasons - don't ask) Am attempting to run the following via cron but it keeps erroring out: kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` kill -9 `ps ax | grep dump | grep -v grep | awk '{print $1}'` Error: usage: kill [-s signal_name] pid ... kill -l [exit_status] kill -signal_name pid ... kill -signal_number pid ... Works OK from commandline - what do I need to change to make this cronable?? The usual problem is that the environment under cron is not set up anything like the way it is for an interactive session. Particularly the PATH. Either write you command as a small shell script and setup PATH within it, or use fully qualified names for all commands. Your command is probably better expressed as: /bin/pkill -9 'backup|dump' Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvNaMAACgkQ8Mjk52CukIzY7ACfaRdjM5GhHDwger7dZyZ0089F asoAn01GiwM4Fxqnf2cfzqhgWxbQmw50 =HqkV -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
RE: Kill via Cron...
On 20/04/2010 08:52:58, mcoyles wrote: Morning all - on FreeBSD 7.1 (for various reasons - don't ask) Am attempting to run the following via cron but it keeps erroring out: kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` kill -9 `ps ax | grep dump | grep -v grep | awk '{print $1}'` *snip* Works OK from commandline - what do I need to change to make this cronable?? The usual problem is that the environment under cron is not set up anything like the way it is for an interactive session. Particularly the PATH. Either write you command as a small shell script and setup PATH within it, or use fully qualified names for all commands. Your command is probably better expressed as: /bin/pkill -9 'backup|dump' Hi Matthew - cheers for that, I always forget the lack of common path in cron *sigh* Anyhoo, there are multiple instances of backup and dump coming back in ps -ax... your suggested command appears to only kill off the first instance? Have used my commands above in cron now using full path reference as per your advice - just waiting for the clock to click round to 11.30 here for them to run... Cheers... Marci ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20/04/2010 11:24:44, mcoyles wrote: On 20/04/2010 08:52:58, mcoyles wrote: Morning all - on FreeBSD 7.1 (for various reasons - don't ask) Am attempting to run the following via cron but it keeps erroring out: kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` kill -9 `ps ax | grep dump | grep -v grep | awk '{print $1}'` *snip* Works OK from commandline - what do I need to change to make this cronable?? The usual problem is that the environment under cron is not set up anything like the way it is for an interactive session. Particularly the PATH. Either write you command as a small shell script and setup PATH within it, or use fully qualified names for all commands. Your command is probably better expressed as: /bin/pkill -9 'backup|dump' Hi Matthew - cheers for that, I always forget the lack of common path in cron *sigh* Anyhoo, there are multiple instances of backup and dump coming back in ps -ax... your suggested command appears to only kill off the first instance? Have used my commands above in cron now using full path reference as per your advice - just waiting for the clock to click round to 11.30 here for them to run... It should kill them all. According to the man page: The pkill command searches the process table on the running system and signals all processes that match the criteria given on the command line. You can change 'pkill' to 'pgrep -l' to see what it would kill without actually killing anything. Note that pkill and pgrep by default won't report any process ancestors in the same process group as themselves unless you use the '-a' flag. So: worm:/usr/src:% pgrep -l tcsh worm:/usr/src:% pgrep -a -l tcsh 1244 tcsh Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvNgp4ACgkQ8Mjk52CukIzBSACdFg+f1ea8b6wvbENW4aTBMCJO RnoAn3CZKziqmAWSoAc8zMbvp5CppcvK =Cjkj -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
mcoyles == mcoyles mcoy...@horbury.wakefield.sch.uk writes: mcoyles kill -9 [from a post I made frequently in comp.unix.questions...] No no no. Don't use kill -9. It doesn't give the process a chance to cleanly: 1) release IPC resources (shared memory, semaphores, message queues) 2) clean up temp files 3) inform its children that it is going away 4) reset its terminal characteristics and so on and so on and so on. Generally, send 15 (SIGTERM), and wait a second or two, and if that doesn't work, send 2 (SIGINT), and if that doesn't work, send 1 (SIGHUP). If that doesn't, REMOVE THE BINARY because the program is badly behaved! Don't use kill -9. Don't bring out the combine harvester just to tidy up the flower pot. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
On Tue, 20 Apr 2010 08:52:58 +0100, mcoyles mcoy...@horbury.wakefield.sch.uk said: M kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` I've typed ps ax | grep something | grep -v grep often enough to automate it. The psax script below accepts an optional egrep-style regex and displays only the matching processes. You can make your life easier by using process groups more often. For example, in the comments below there are four separate httpd processes in the same process group. If I wanted to kill them all, I could send HUP to PGID 198 instead of using four kill commands. There's a perl version of kill included in Perl power tools. I made some minor changes to use process groups instead: http://www.pobox.com/~vogelke/src/toolbox/perl/killpg.txt -- Karl Vogel I don't speak for the USAF or my company Son, looks to me like you're spending too much time on one subject. --Shelby Metcalf, basketball coach at Texas AM, to a player who received four F's and one D --- #!/bin/sh #psax: runs ps, looks for an optional egrep regex (BSD version). # # me% psax 'super|http' # USERPID PPID PGID RSZ TT STARTED TIME COMMAND # root198 1 198 1384 ?? 11Jul09 7:53.76 /path/to/httpd -DSSL # www 252 198 198 1976 ?? 11Jul09 0:44.96 /path/to/httpd -DSSL # www 253 198 198 1992 ?? 11Jul09 0:47.81 /path/to/httpd -DSSL # www 54291 198 198 1992 ?? 13Jul09 0:47.78 /path/to/httpd -DSSL # root 92729 204 8 304 ?? 25Feb10 0:01.25 supervise qmail-send # root 92730 204 8 300 ?? 25Feb10 0:01.40 supervise log # root 92731 204 8 304 ?? 25Feb10 0:01.04 supervise qmail-smtpd # root 92732 204 8 300 ?? 25Feb10 0:01.16 supervise log PATH=/bin:/usr/sbin:/usr/bin:/usr/local/bin export PATH umask 022 # Solaris: ps -cef -o user,pid,pgid,class,pri,rss,time,args # Linux: ps ax -o user,pid,pgid,rss,start,bsdtime,args cmd=ps -axw -o user,pid,ppid,pgid,rsz,tt,start,time,command case $# in 0) exec $cmd ;; *) exec $cmd | egrep COMMAND|$* | egrep -v egrep|/bin/sh $0 ;; esac exit 0 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
Karl == Karl Vogel voge...@hcst.com writes: On Tue, 20 Apr 2010 08:52:58 +0100, mcoyles mcoy...@horbury.wakefield.sch.uk said: M kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` And you don't have to remember grep -v grep if you remember to use ps axc (note the c), since arguments won't show up so the arguments to grep won't generate a false positive. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Kill via Cron...
On Tue, Apr 20, 2010 at 12:57:25PM -0700, Randal L. Schwartz wrote: Karl == Karl Vogel voge...@hcst.com writes: On Tue, 20 Apr 2010 08:52:58 +0100, mcoyles mcoy...@horbury.wakefield.sch.uk said: M kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` And you don't have to remember grep -v grep if you remember to use ps axc (note the c), since arguments won't show up so the arguments to grep won't generate a false positive. Alternatively: ps ax | grep [b]ackup | awk '{print $1}' Or to avoid being nominated for something like the Useless Use of Cat award: ps ax | awk '/[b]ackup/ {print $1}' Making use pgrep/pkill would seem to make the most sense. -- George ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Trying run a php script from cron
I am trying to run a php script from the cron tab and these are the errors I receive: /usr/local/bin/php php -q /home//ripper.php result Could not open input file: php /usr/local/bin/php php -/home//ripper.php result Could not open input file: php /usr/local/bin/php -/home//ripper.php result This script must be called from the command line. Running Freebsd 8.0, Php 5.2.12 I have chmod the script 644 still no luck tried it chmod 777 still no luck. I have goggled this problem and followed the tutorials but still no luck. Any ideas how I can get the script to run? I can run run it from the command line without any problems. Thanks Darrell Betts be...@norden1.com --- Looks like I Picked the Wrong Week to Stop Sniffing Glue. -- Steve McCroskey -- Live ATC Feed from Toledo Express Airport http://d.liveatc.net/ktol.m3u ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Trying run a php script from cron
I am trying to run a php script from the cron tab and these are the errors I receive: /usr/local/bin/php php -q /home//ripper.php result Could not open input file: php /usr/local/bin/php php -/home//ripper.php result Could not open input file: php /usr/local/bin/php -/home//ripper.php result This script must be called from the command line. Running Freebsd 8.0, Php 5.2.12 I have chmod the script 644 still no luck tried it chmod 777 still no luck. I have goggled this problem and followed the tutorials but still no luck. Any ideas how I can get the script to run? I can run run it from the command line without any problems. Instead of /usr/local/bin/php php -q /home//ripper.php try /usr/local/bin/php -f /home//ripper.php or just /usr/local/bin/php /home//ripper.php You can also try a script like this one: #!/usr/local/bin/php -f ?php echo foo\n; ? And running it like this: /home//ripper.php after chmod'ing it to be executable. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
How to run cron scripts (310.locate) in chrooted env.
Hi: I have a setup with diskless clients mounting /var/diskless/FreeBSD read-only as root file system. How do I configure cron/locate.rc to run on the server such that the locate database is relative to the root for the diskless systems? I could do a chroot and run it within this environment, at least it would work manually. Thanks, Erik -- Erik Nørgaard Ph: +34.666334818/+34.915211157 http://www.locolomo.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
export PATH in script called via Cron.
I have a script that I call via Cron. It wont work unless I include a path: #!/usr/local/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin export $PATH which is fine and works. Out of curiosity though, why is it that if I call it from the cl like ./test.sh I get this error: ./test.sh: line 3: export: `/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin': not a valid identifier The script still works but it does drop that error. What does it mean? Thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: export PATH in script called via Cron.
2009/10/16 Paul Halliday paul.halli...@gmail.com I have a script that I call via Cron. It wont work unless I include a path: #!/usr/local/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin export $PATH which is fine and works. Out of curiosity though, why is it that if I call it from the cl like ./test.sh I get this error: ./test.sh: line 3: export: `/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin': not a valid identifier The script still works but it does drop that error. What does it mean? Thanks. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org drop the $ in front of path in the export line ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Resetting user password in cron
Glen Barber glen.j.bar...@gmail.com writes: On Thu, Jul 16, 2009 at 8:39 PM, Jos Chrispijnj...@webrz.net wrote: Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Hi, Jos You can use chpass(1) in root's crontab: http://www.freebsd.org/cgi/man.cgi?query=chpasssektion=1 And note the '-p' option in particular. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Resetting user password in cron
Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Jos Chrispijn ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Resetting user password in cron
On Thu, Jul 16, 2009 at 8:39 PM, Jos Chrispijnj...@webrz.net wrote: Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Hi, Jos You can use chpass(1) in root's crontab: http://www.freebsd.org/cgi/man.cgi?query=chpasssektion=1 -- Glen Barber ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Resetting user password in cron
On Fri, Jul 17, 2009 at 02:39:51AM +0200, Jos Chrispijn wrote: Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Jos Chrispijn man pw man chpass Josef -- Josef Grosch | Another day closer to a | FreeBSD 7.2 jgro...@mooseriver.com | Micro$oft free world | Berkeley, Ca. pgp9eDtJNy3a1.pgp Description: PGP signature
Re: Resetting user password in cron
On Thursday 16 July 2009 16:39:51 Jos Chrispijn wrote: Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Take a look at pw(8), specifically usermod command, -h and -H option. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Resetting user password in cron
On 7/16/09, Jos Chrispijn j...@webrz.net wrote: Can someone tell me how I can reset a user's password best in a cron job? If I do a password change from the prompt, I now have to re-enter the password, which I would not like to do in a cron job. Thanks/ Jos Chrispijn yes newpasswd | passwd username :) not tried it myself. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
cron output mail contains no recipient address
Hiya all Ever since I upgraded my backup server to 7.2R (via source compile) cron jobs that produce output that used to be emailed to me now fail with a report of contained no recipient addresses on the receiving server. Mail setup is very basic, just exim that delivers to the main server. A command like ls | mail -s test root will work fine, it is only the cron outputs that have no to: line (root is aliased in the /etc/aliases) Any ideas? Google has been unhelpful, so far -- DA Fo rsythNetwork Supervisor Principal Technical Officer -- Institute for Water Research http://www.ru.ac.za/institutes/iwr/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
cron mail problem solved
Why do I become so clever AFTER asking for help? Anyhow, I have solved the cron not sending email problem. The cron log file contains lines like this NSSWITCH(nss_method_lookup): nis, group_compat, setgrent, not found which when searched for produces the page at http://www.ivorde.ro/FreeBSD_Cron__NSSWITCH_nss_method_lookup_errors- 44.html So I have edited my /etc/nsswitch.conf to have group: files password: files (instead of 'compat') and now it works again. I guess I must have installed that file in the upgrade during my glazed mergemaster phase of 'esc i enter' to install all those files whose only difference is the $Id$ tag (why do they bother?) -- DA Fo rsythNetwork Supervisor Principal Technical Officer -- Institute for Water Research http://www.ru.ac.za/institutes/iwr/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron mail problem solved
On Mon, Jun 15, 2009 at 11:11:14AM +0200, DA Forsyth wrote: Why do I become so clever AFTER asking for help? Anyhow, I have solved the cron not sending email problem. The cron log file contains lines like this NSSWITCH(nss_method_lookup): nis, group_compat, setgrent, not found which when searched for produces the page at http://www.ivorde.ro/FreeBSD_Cron__NSSWITCH_nss_method_lookup_errors- 44.html So I have edited my /etc/nsswitch.conf to have group: files password: files (instead of 'compat') and now it works again. I guess I must have installed that file in the upgrade during my glazed mergemaster phase of 'esc i enter' to install all those files whose only difference is the $Id$ tag (why do they bother?) You can get mergemaster to ignore those cvs tags. In /etc/mergemaster.rc: DIFF_FLAG='-Bub' DIFF_OPTIONS='-I$FreeBSD:.*[$]' IGNORE_FILES='/etc/motd /etc/mail/mailer.conf /etc/printcap' The 2nd line above tells diff to ignore lines that match that RE. Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: cron mail problem solved
On 6/15/09, DA Forsyth d.fors...@ru.ac.za wrote: Why do I become so clever AFTER asking for help? Anyhow, I have solved the cron not sending email problem. The cron log file contains lines like this NSSWITCH(nss_method_lookup): nis, group_compat, setgrent, not found which when searched for produces the page at http://www.ivorde.ro/FreeBSD_Cron__NSSWITCH_nss_method_lookup_errors- 44.html So I have edited my /etc/nsswitch.conf to have group: files password: files (instead of 'compat') and now it works again. I guess I must have installed that file in the upgrade during my glazed mergemaster phase of 'esc i enter' to install all those files whose only difference is the $Id$ tag (why do they bother?) mergemaster(8) -F Lots of options, maybe check it out. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Limiting resources in cron jobs
exec the script with softlimit from daemontools (very easy to use), or exec with ulimit in the shell. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Limiting resources in cron jobs
On Saturday 16 May 2009 19:27:22 Kirk Strauser wrote: www:\ :cputime=300:\ :tc=default: I've run cap_mkdb /etc/login.conf to make that live. Then, I used vipw to change www's class: www:*:80:80:www:0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin However, I can trigger the error condition and watch the child Ghostscript process run for 6-7 minutes before I kill it. Check with top what the CPU time is, it's not the same as the wall clock. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Limiting resources in cron jobs
On May 20, 2009, at 7:00 AM, Mel Flynn wrote: Check with top what the CPU time is, it's not the same as the wall clock. Give me *some* credit. :-) -- Kirk Strauser ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Limiting resources in cron jobs
On Wednesday 20 May 2009 16:18:28 Kirk Strauser wrote: On May 20, 2009, at 7:00 AM, Mel Flynn wrote: Check with top what the CPU time is, it's not the same as the wall clock. Give me *some* credit. :-) Sorry, haven't you heard? Financial crisis ;) Are you sure cron respects login.conf? I don't see it mentioned in the man page. Have you tried modifying the offending crontab to run using limits(1) program? AFAIK, cron doesn't use login(1) or underlying infrastructure, yet it uses pam. -- Mel ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Limiting resources in cron jobs
I have a jail where the www user runs hourly cron jobs. On rare occasion, these jobs get stuck in a seemingly infinite CPU loop - a Python script calls Ghostscript and that child process never returns - and I have to manually kill them. I'd like to use login.conf to set resource limits so that I don't have to do this myself, but they don't seem to be applied. Here's a snippet of my login.conf: www:\ :cputime=300:\ :tc=default: I've run cap_mkdb /etc/login.conf to make that live. Then, I used vipw to change www's class: www:*:80:80:www:0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin However, I can trigger the error condition and watch the child Ghostscript process run for 6-7 minutes before I kill it. It's my understand that cron uses the limits from login.conf. Any idea what I might be doing wrong and causing it not to do so? -- Kirk Strauser ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Cron Not Sending Mail
On Wed, Mar 4, 2009 at 11:38 AM, Morgan Wesström freebsd-questi...@pp.dyndns.biz wrote: Yeah, I am aware what dnl does. The reason I commented that stuff out is because I have no use for any of it - all those files (access, local-host-names, mailertable, virtusertable, etc) are all empty by default and I had no reason to add anything to them. I'll try going back to the default config and putting the RELAY line in the access file. Thanks once again for the help. I really do appreciate the time. Sendmail is not an open relay by default so you need at least one RELAY entry in /etc/mail/access for it to forward mail externally. I'm still curious of where it picks up that w...@localhost but chances are it will disappear as soon as you have a valid access config. /Morgan ___ I still can't figure this whole issue out. I've tried everything suggested in this thread, including reverting back to the default sendmail config files. I created a work-around by just piping all my crontabs into /usr/bin/mail and sending output using that method. It doesn't solve it, but it works for now. Thanks for all the help. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Cron Not Sending Mail
APseudoUtopia wrote: In my case I only see either local there or my smart host as defined in /var/mail/{hostname}.mc Can you provide a diff -u between /etc/mail/freebsd.mc and /etc/mail/{hostname}.mc ? /Morgan I'd switch over to postfix, but I'm only using this to send output from cron and the daily security run scripts. I don't receive any mail over the network, so I think it'd be pointless to go through the effort of switching and configuring another MTA. Here's the diff. I figured it was too long to include in the email (word wrap will make it hard to read :-P) http://pastebin.ca/1352338 I'm no expert on Sendmail but you are aware that dnl is Sendmail's way of commenting out a line, aren't you? In your config you have disabled pretty much every configuration file in /etc/mail, especially /etc/mail/access which defines who can relay mail through the local MTA. I'm pretty sure this isn't a good idea. Apart from this I couldn't see any major differences between your config and FreeBSD's default. Why not try to use the default config and make sure to populate /etc/mail/access with at least 127.0.0.1 RELAY and try again? /Morgan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Cron Not Sending Mail
On Wed, Mar 4, 2009 at 5:36 AM, Morgan Wesström freebsd-questi...@pp.dyndns.biz wrote: APseudoUtopia wrote: In my case I only see either local there or my smart host as defined in /var/mail/{hostname}.mc Can you provide a diff -u between /etc/mail/freebsd.mc and /etc/mail/{hostname}.mc ? /Morgan I'd switch over to postfix, but I'm only using this to send output from cron and the daily security run scripts. I don't receive any mail over the network, so I think it'd be pointless to go through the effort of switching and configuring another MTA. Here's the diff. I figured it was too long to include in the email (word wrap will make it hard to read :-P) http://pastebin.ca/1352338 I'm no expert on Sendmail but you are aware that dnl is Sendmail's way of commenting out a line, aren't you? In your config you have disabled pretty much every configuration file in /etc/mail, especially /etc/mail/access which defines who can relay mail through the local MTA. I'm pretty sure this isn't a good idea. Apart from this I couldn't see any major differences between your config and FreeBSD's default. Why not try to use the default config and make sure to populate /etc/mail/access with at least 127.0.0.1 RELAY and try again? /Morgan Yeah, I am aware what dnl does. The reason I commented that stuff out is because I have no use for any of it - all those files (access, local-host-names, mailertable, virtusertable, etc) are all empty by default and I had no reason to add anything to them. I'll try going back to the default config and putting the RELAY line in the access file. Thanks once again for the help. I really do appreciate the time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Cron Not Sending Mail
Yeah, I am aware what dnl does. The reason I commented that stuff out is because I have no use for any of it - all those files (access, local-host-names, mailertable, virtusertable, etc) are all empty by default and I had no reason to add anything to them. I'll try going back to the default config and putting the RELAY line in the access file. Thanks once again for the help. I really do appreciate the time. Sendmail is not an open relay by default so you need at least one RELAY entry in /etc/mail/access for it to forward mail externally. I'm still curious of where it picks up that w...@localhost but chances are it will disappear as soon as you have a valid access config. /Morgan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org