[rancid] problem with rancid crontab

Vacheslav m_zouhairy at skno.by
Wed Oct 4 05:44:28 UTC 2017


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>; 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:inte
ractive_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/540ddeef/attachment.html>


More information about the Rancid-discuss mailing list