(INSTALL) symlink confusion: can't find qmailctl

1 view
Skip to first unread message

Bald Headed John

unread,
Jun 30, 2001, 1:43:08 PM6/30/01
to

Hi; I've just been installing qmail follwing the step-by-step in "life
with qmail" (EXCELLENT doc, Dave!)

First I was getting errors like this:

[root@splendrix rc.d]# qmailctl stat
: No such file or directory
: command not found
: command not found
': not a valid identifier: `PATH
: command not found
: command not found
'usr/bin/qmailctl: line 13: syntax error near unexpected token `in
'usr/bin/qmailctl: line 13: `case "$1" in
[root@splendrix rc.d]# qmailctl cdb
: No such file or directory
: command not found
: command not found
': not a valid identifier: `PATH
: command not found
: command not found
'usr/bin/qmailctl: line 13: syntax error near unexpected token `in
'usr/bin/qmailctl: line 13: `case "$1" in

Well, I think I figured that out; I was missing the "she" in the
shebang" at the beginning of the file.. don't know how that hapeened,
but whatever, so I repaired it (using emacs).

[root@splendrix rc.d]# emacs /var/qmail/bin/qmailctl

But now the system can't seem to find qmailctl, It's there if O look
for it, but not if I try to run it... permissions say it's
executable... what the heck?

I'm sure this is some simple thing having to do with the symlinks,
probably hbecause I edited the qmailctl file after making the links,
but I can't figure it out. Or is it an ownership problem?

Here's me grilling my machine on what the deal is:

[root@splendrix rc.d]# qmailctl stat
bash: /usr/bin/qmailctl: No such file or directory

hunh, maybe the link's broken...

[root@splendrix rc.d]# /var/qmail/bin/qmailctl stat
bash: /var/qmail/bin/qmailctl: No such file or directory

what?

[root@splendrix rc.d]# /var/qmail/bin/qmailctl
bash: /var/qmail/bin/qmailctl: No such file or directory

that's what I thought you said! Well how about...

[root@splendrix rc.d]# ls -l /var/qmail/bin/qmailctl
-rwxr-xr-x 1 root qmail 2937 Jun 29 23:10 \
/var/qmail/bin/qmailctl
[root@splendrix rc.d]# ls -l /etc/rc.d/init.d/qmail
lrwxrwxrwx 1 root root 23 Jun 29 21:43 \
/etc/rc.d/init.d/qmail -> /var/qmail/bin/qmailctl
[root@splendrix rc.d]# ls -l /usr/bin/qmailctl
lrwxrwxrwx 1 root root 23 Jun 29 21:45 \
/usr/bin/qmailctl -> /var/qmail/bin/qmailctl
[root@splendrix rc.d]# qmailctl stat
bash: /usr/bin/qmailctl: No such file or directory
[root@splendrix rc.d]# whoami
root

ok, I'm root, the links are there, and yet there's no such file.

I must be some kind of idiot.

Please help!


Bald Headed John
"Falcum...Take me to da Falcum"

Bald Headed John

unread,
Jul 3, 2001, 12:57:43 AM7/3/01
to

Hi kids,
I've been working on this since Saturday but haven't figured it out
yet; anyone have any clues?

I now understand that the problem is NOT that the shell can't find
qmailctl, but that when it runs the script, it runs into a file it
doesn't understand.

But which one?

I've been stepping through the script, executing each line at the
command line, but everything seems to go down the pipe ok.

I don't understand a couple things that it does though:

if svok /service/qmail-send ; then
svc -u /service/qmail-send

what are svc and svok? they have no man or info page, and they're not
in my books (the unix admin system handbook, Oreilly Linux in a
nutshell). I guess I'll try a web search for them next.

tia.

Dave Sill

unread,
Jul 3, 2001, 2:41:16 PM7/3/01
to
Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> writes:

> Hi; I've just been installing qmail follwing the step-by-step in "life
> with qmail" (EXCELLENT doc, Dave!)

Thanks.

> But now the system can't seem to find qmailctl, It's there if O look
> for it, but not if I try to run it... permissions say it's
> executable... what the heck?

Sounds like more shebang problems--like DOS CR-LF linebreaks. What
does "head -1 /var/qmail/bin/qmailctl | od -c" say? It should look
like:

0000000 # ! / b i n / s h \n
0000012

> I'm sure this is some simple thing having to do with the symlinks,
> probably hbecause I edited the qmailctl file after making the links,
> but I can't figure it out. Or is it an ownership problem?

Doubtful. If it's a symlink problem, try doing "type qmailctl" to see
where it's being found in your path. Then do "ls -l
/path/to/qmailctl", which should look like:

# ls -l /usr/bin/qmailctl
lrwxr-xr-x 1 root root 23 Jul 3 14:37 /usr/bin/qmailctl -> /var/qmail/bin/qmailctl

Then do "ls -l /var/qmail/bin/qmailctl":

# ls -l /var/qmail/bin/qmailctl
-rwxr-xr-x 1 root root 2369 Jul 3 14:36 /var/qmail/bin/qmailctl

> [root@splendrix rc.d]# ls -l /var/qmail/bin/qmailctl
> -rwxr-xr-x 1 root qmail 2937 Jun 29 23:10 \
> /var/qmail/bin/qmailctl
> [root@splendrix rc.d]# ls -l /etc/rc.d/init.d/qmail
> lrwxrwxrwx 1 root root 23 Jun 29 21:43 \
> /etc/rc.d/init.d/qmail -> /var/qmail/bin/qmailctl
> [root@splendrix rc.d]# ls -l /usr/bin/qmailctl
> lrwxrwxrwx 1 root root 23 Jun 29 21:45 \
> /usr/bin/qmailctl -> /var/qmail/bin/qmailctl

OK, that all looks good. Check the shebang line for CR's.

> I must be some kind of idiot.

Not at all. This is a tricky issue to debug.

--
Dave Sill <MaxFr...@sws5.ctd.ornl.gov> <http://web.infoave.net/~dsill>
Oak Ridge National Lab, Workstation Support
<http://www.lifewithqmail.org>: almost everything you always wanted to know.

Dave Sill

unread,
Jul 3, 2001, 2:42:52 PM7/3/01
to
Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> writes:

> I don't understand a couple things that it does though:
>
> if svok /service/qmail-send ; then
> svc -u /service/qmail-send
>
> what are svc and svok?

Pieces of the daemontools package. See:

http://cr.yp.to/daemontools.html

Bald Headed John

unread,
Jul 4, 2001, 3:39:03 AM7/4/01
to

Ok, _how_much_ should it look like that?
[root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
0000000 # ! / b i n / s h \r \n
0000013

It's got another \r in there, and the number on the next line is
different, so I looked at the other stuff you were talking about:

[root@splendrix /root]# type qmailctl
qmailctl is /usr/bin/qmailctl

ok, I knew that. So let's try getting rid of that \r thing:

[root@splendrix /root]# emacs /usr/bin/qmailctl
[root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
0000000 # ! / b i n / s h \r \n
0000014

hmmm, that didn't work, what is that od thing anyway?

[root@splendrix /root]# man od

Oh! Cool!
Well, maybe it really DID work:

[root@splendrix /root]# qmailctl start


bash: /usr/bin/qmailctl: No such file or directory

Oh, it didn't. I'll try it again, and take the space outof there
:
[root@splendrix /root]# emacs /usr/bin/qmailctl
[root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
0000000 # ! / b i n / s h \r \n
0000013

Well, maybe emacs is screwing it up. I'll use vi instead:

[root@splendrix /root]# vi /usr/bin/qmailctl
[root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
0000000 # ! / b i n / s h \r \n
0000013

and did it really work?
[root@splendrix /root]# qmailctl start


bash: /usr/bin/qmailctl: No such file or directory

No such luck.
Dave, I looked at what you wrote about the symlinks, and well, if
that's all there is to it, then I guess I already knew all about
symlinks, I just didn't know there wasm't more magic in there
somewhere...

meanwhile, I'll look at the daemontools stuff and learn more about
that. I don't have much idea where to go from here, but I'll keep
trying. Help appreciated of course!!!

thx in retard ( the opposite of tia, right?)
bhj

On 03 Jul 2001 14:41:16 -0400, Dave Sill
<MaxFr...@sws5.ctd.ornl.gov> wrote:

Bald Headed John

Bald Headed John

unread,
Jul 5, 2001, 2:34:36 AM7/5/01
to

FIXED IT!

I just got the qmailctl script directly off of the server.
Now it starts qmail... sorry for the fuss! I guess there was some
characters in there that editing was not getting rid of. Thanks for
pointimg me in the right direction, Dave!

Now, however, on to the next problem:

[root@splendrix /root]# qmailctl start

Starting qmail
qmail-send service not running
qmail-smtpd service not running
[root@splendrix /root]# qmailctl stop
Stopping qmail...
qmail-smtpd
svc: warning: unable to control /service/qmail-smtpd: file does not
exist
qmail-send
svc: warning: unable to control /service/qmail-send: file does not
exist

Ok, so I've been snooping around, but maybe you could point me at the
best part of the docs to read regarding this problem? I have, of
course, been diligently reviewing Life With qmail.

bhj

Dave Sill

unread,
Jul 6, 2001, 1:26:43 PM7/6/01
to
Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> writes:

> Ok, _how_much_ should it look like that?

Exactly.

> [root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
> 0000000 # ! / b i n / s h \r \n
> 0000013
>
> It's got another \r in there, and the number on the next line is
> different,

That means the file DOS-style carriage return/line feed newlines. The
\r is a carriage return, and \n is linefeed, aka UNIX "newline".

> hmmm, that didn't work, what is that od thing anyway?

Octal dump--it displays non-printable characters.

> thx in retard ( the opposite of tia, right?)

Er, sure, John. :-)

I see from your next message that you resolved this by re-grabbing the
script. It's also possible to fix it using various UNIX utilities like
tr ("tr -d '\r'") or dos2unix, if you have it.

Dave Sill

unread,
Jul 6, 2001, 1:30:05 PM7/6/01
to
Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> writes:

> [root@splendrix /root]# qmailctl start
> Starting qmail
> qmail-send service not running
> qmail-smtpd service not running
> [root@splendrix /root]# qmailctl stop
> Stopping qmail...
> qmail-smtpd
> svc: warning: unable to control /service/qmail-smtpd: file does not
> exist
> qmail-send
> svc: warning: unable to control /service/qmail-send: file does not
> exist
>
> Ok, so I've been snooping around, but maybe you could point me at the
> best part of the docs to read regarding this problem? I have, of
> course, been diligently reviewing Life With qmail.

Sounds like you haven't got svscan running on the /service
directory. Doublecheck the daemontools installation instructions in
LWQ: it's in there.

Bald Headed John

unread,
Jul 8, 2001, 12:22:00 PM7/8/01
to

HOORAY!!!

Thanks for pointing me in the right direction AGAIN, Dave,

Apparently, the REAL key to this one was to get outta my chair and
clean out my turtle's habitat. I guess the noxious gasses arising
therefrom were de-storting my brainiac wavelets.
(i.e. I made a typo in my inttab line for svscan. )

up & running!

Thanksssss!!!

bhj

On 06 Jul 2001 13:26:43 -0400, Dave Sill
<MaxFr...@sws5.ctd.ornl.gov> wrote:

>Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> writes:
>
>> Ok, _how_much_ should it look like that?
>
>Exactly.
>
>> [root@splendrix /root]# head -1 /var/qmail/bin/qmailctl | od -c
>> 0000000 # ! / b i n / s h \r \n
>> 0000013
>>
>> It's got another \r in there, and the number on the next line is
>> different,
>
>That means the file DOS-style carriage return/line feed newlines. The
>\r is a carriage return, and \n is linefeed, aka UNIX "newline".
>
>> hmmm, that didn't work, what is that od thing anyway?
>
>Octal dump--it displays non-printable characters.
>
>> thx in retard ( the opposite of tia, right?)
>
>Er, sure, John. :-)
>
>I see from your next message that you resolved this by re-grabbing the
>script. It's also possible to fix it using various UNIX utilities like
>tr ("tr -d '\r'") or dos2unix, if you have it.

Bald Headed John

Reply all
Reply to author
Forward
0 new messages