I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!? Script follows: #!/bin/sh # # Script to check if modem is disconnected & try reconnecting # result=$(cinternet -i ppp0 -s | grep disconnect) #Checks the status of device dsl0 for the word 'disconnect' and stores the #result in a variable called 'result' if [ -n "$result" ] #Test to see if the value is not NULL then #OK the interface is down cinternet -i ppp0 -A #Start the interface. sleep 10 else #The interface is up - Just exit exit 0 fi -- ...CH SuSE 9 Works Linux user# 313696 Linux box# 199365
On Sunday 30 May 2004 01.36, C Hamel wrote:
I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!?
Do you have permissions to execute it? Try chmod 755 /usr/local/bin/ck_internet
On Sunday 30 May 2004 01.36, C Hamel wrote:
I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!?
Do you have permissions to execute it? Try
chmod 755 /usr/local/bin/ck_internet Is there a wy to put this in the permissions.local file? I had entered it in
On Saturday 29 May 2004 18:45, Anders Johansson wrote: there, but it seemed to make no difference ...unless I specified the user.group incorrectly, or something. I had: /usr/local/ck_internet root.dialout 755 ...I then tried 6754 which I use for pppd quite effectively, and I still had errors. It works, now, I'm just wondering what other options might be. Thanks1 -- ...CH SuSE 9 Works Linux user# 313696 Linux box# 199365
On Sunday 30 May 2004 02.22, C Hamel wrote:
Is there a wy to put this in the permissions.local file? I had entered it in there, but it seemed to make no difference
Just putting it in that file doesn't do anything by itself. If you want it to take effect you need to run "SuSEconfig --module permissions", and/or run the chmod command manually
...unless I specified the user.group incorrectly, or something. I had: /usr/local/ck_internet root.dialout 755 ...I then tried 6754
First of all, the suid and sgid bits aren't used at all for shell scripts, so if you want to run this script you will either need to run it as root, or have the binaries it runs (cinternet) have the proper permissions. It is a client/server thing, that calls the smpppd server, so I don't think you need it to be root/dialout at all. Secondly, if it had been a binary, and you had needed the suid, the permissions are a little inconsistent. the '6' at the start means 'suid + sgid', but the '4' at the end doesn't give you permission to execute the program unless you are already either root or in the dialout group, so 4750 is probably what you're looking for. I believe that is the default for pppd, to allow dialout only to those in the group 'dialout' 6755, if you absolutely must be in the group as well, and want to allow execute access to people who aren't. But like I said, for shell scripts suid and sgid aren't used at all, so the above is a little academic :)
On Saturday 29 May 2004 19:44, Anders Johansson wrote: <SNIP>
Just putting it in that file doesn't do anything by itself. If you want it to take effect you need to run "SuSEconfig --module permissions", and/or run the chmod command manually I did run the SuSEconfig ...but no --module permissions afterward.
<SNIP>
/usr/local/ck_internet root.dialout 755 ...I then tried 6754
First of all, the suid and sgid bits aren't used at all for shell scripts, so if you want to run this script you will either need to run it as root, or have the binaries it runs (cinternet) have the proper permissions. It is a client/server thing, that calls the smpppd server, so I don't think you need it to be root/dialout at all.
Secondly, if it had been a binary, and you had needed the suid, the permissions are a little inconsistent. the '6' at the start means 'suid + sgid', but the '4' at the end doesn't give you permission to execute the program unless you are already either root or in the dialout group, so 4750 is probably what you're looking for. I believe that is the default for pppd, to allow dialout only to those in the group 'dialout'
6755, if you absolutely must be in the group as well, and want to allow execute access to people who aren't.
But like I said, for shell scripts suid and sgid aren't used at all, so the above is a little academic :) I find it a bit complicated... but am beginning to understand it a little bit. Been a long, long time since I had to worry about bits --like roughly 20 yrs.
Thanks for explaining it! -- ...CH SuSE 9 Works Linux user# 313696 Linux box# 199365
On Sat, 2004-05-29 at 19:36, C Hamel wrote:
I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!? Script follows:
If I understand your error correctly it looks to me like you don't have either the correct user permissions on the script or you don't have the execute bits set. Check the ownership of the script and the permission bits. One of those is not correct. -- Scot L. Harris <webid@cfl.rr.com>
On Saturday 29 May 2004 18:52, Scot L. Harris wrote:
On Sat, 2004-05-29 at 19:36, C Hamel wrote:
I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!? Script follows:
If I understand your error correctly it looks to me like you don't have either the correct user permissions on the script or you don't have the execute bits set.
Check the ownership of the script and the permission bits. One of those is not correct.
-- Scot L. Harris <webid@cfl.rr.com> Yep... makes a difference. Also, discovered white space where it shouldn't be. Betwixt the both, no worky. :-\ Now, worky!
Thanks! -- ...CH SuSE 9 Works Linux user# 313696 Linux box# 199365
-----Original Message----- From: C Hamel <vgm2@sc2000.net> To: suse-linux-e@suse.com Date: Sat, 29 May 2004 18:36:51 -0500 Subject: [SLE] CRON Question
I am using a script donated by one of our group to keep my internet connection [hopefully] alive. I am having some problem w/the CRON e-mailing an error to me each & every time it executes --whether as root or <user>. The error follows: '/bin/sh: Line 1: /usr/local/bin/ck_internet: Permission denied' For some odd reason is is not appearing as a script, though right out of the box it states in line 1: '#!/bin/sh' as any script I've made does & is recognized. What's wrong!? Script follows: #!/bin/sh # # Script to check if modem is disconnected & try reconnecting # <snip>
I would check the perms and make sure that the script is executable, i.e. -rwxr-xr-x perms would make it excutable for anyone. Change to suite your needs. Ken
participants (4)
-
Anders Johansson
-
C Hamel
-
Ken Schneider
-
Scot L. Harris