[rancid] problem with rancid crontab
Alexander Griesser
AGriesser at anexia-it.com
Wed Oct 4 05:52:55 UTC 2017
What operating system is this? I'm not sure why this is happening for you, but this might as well be just because you're running the jobs in the system cron and the environment is not being passed to the script upon execution.
Can you please just try to add this crontab line to the rancid user's cron?
i.e. login as user rancid (f.ex. `su - rancid`) and then run `crontab -e` and add the cron there? This should definitely fix it.
The only change necessary in the crontab line is to remove the column with the username "rancid".
best,
Alexander Griesser
Head of Systems Operations
ANEXIA Internetdienstleistungs GmbH
E-Mail: AGriesser at anexia-it.com<mailto:AGriesser at anexia-it.com>
Web: http://www.anexia-it.com<http://www.anexia-it.com/>
Anschrift Hauptsitz Klagenfurt: Feldkirchnerstraße 140, 9020 Klagenfurt
Geschäftsführer: Alexander Windbichler
Firmenbuch: FN 289918a | Gerichtsstand: Klagenfurt | UID-Nummer: AT U63216601
Von: Rancid-discuss [mailto:rancid-discuss-bounces at shrubbery.net] Im Auftrag von Vacheslav
Gesendet: Mittwoch, 4. Oktober 2017 07:44
An: 'Alex DEKKER' <rancid at ale.cx>; rancid-discuss at shrubbery.net
Betreff: Re: [rancid] problem with rancid crontab
So how to change home from / to /var/rancid?
From: Rancid-discuss [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Vacheslav
Sent: Tuesday, October 3, 2017 5:59 PM
To: 'Alex DEKKER' <rancid at ale.cx<mailto:rancid at ale.cx>>; rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] problem with rancid crontab
Good observation, I was creating it using winscp, now I nanoed it and the log file produced:
export HOME="/"
export LANG="en_US.utf8"
export LOGNAME="rancid"
export MAILTO="root"
export OLDPWD
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
export PWD="/"
export SHELL="/bin/bash"
export SHLVL="2"
export USER="rancid"
export _="/tmp/test2.sh"
BASH=/bin/sh
BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/tmp/test2.sh")
BASH_VERSINFO=([0]="4" [1]="3" [2]="48" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='4.3.48(1)-release'
DIRSTACK=()
EUID=103
GROUPS=()
HOME=/
HOSTNAME=nagios
HOSTTYPE=x86_64
IFS='
'
LANG=en_US.utf8
LOGNAME=rancid
MACHTYPE=x86_64-pc-linux-gnu
MAILTO=root
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PIPESTATUS=([0]="0")
POSIXLY_CORRECT=y
PPID=22660
PS4='+ '
PWD=/
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:interactive-comments:posix
SHLVL=2
TERM=dumb
UID=103
USER=rancid
_=export
/
From: Rancid-discuss [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Alex DEKKER
Sent: Tuesday, October 3, 2017 5:53 PM
To: rancid-discuss at shrubbery.net<mailto:rancid-discuss at shrubbery.net>
Subject: Re: [rancid] problem with rancid crontab
On 03/10/17 15:37, Vacheslav wrote:
Well it didn't run because when I su rancid and execute:
/root $ /tmp/test.sh
bash: /tmp/test.sh: /bin/sh^M: bad interpreter: No such file or directory
running: sh /tmp/test.sh
produces a log file with the following content:
/root
How to fix the script?
If there really is a ^M on the first line of the script then that suggests it was created with "DOS" line endings. What are you using to edit files? I can imagine that unexpected DOS line endings will cause the various components of RANCID to fail in unexpected ways.
alexd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20171004/985a24a5/attachment.html>
More information about the Rancid-discuss
mailing list