LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-08-2015, 11:59 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
[SOLVED] /etc/rc.d/rc.postfix: Permission denied


I built the postfix packaged (removed sendmail beforehand) from slackbuilds.org manually and installed the package (I have dovecot installed) and when I run /etc/rc.d/rc.postfix start the terminal I get a permission denied error. rc.postfix is in /etc/rc.d however it is not green like the other files, doing chmod +x makes it green/executable but when typing the command it ends up just returning nothing.

I know this is not a lot of information for you, but I do not know what to give you (a build log?). Ill continue to debug and post more back here.

EDIT: Looking in rc.postfix, it calls /usr/sbin/postfix start ....I ran that in the terminal and what do you know postfix starts, so it seems to just be something wrong with permissions in the file? Here is a ls -lr of /etc/rc.d

Code:
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc6.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc5.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc4.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc3.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc2.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc1.d/
drwxr-xr-x 2 root root  4096 Sep 23  2008 rc0.d/
-rw-r--r-- 1 root root  3683 Oct 17  2013 rc.yp
-rw------- 1 root root  7320 Aug 19  2012 rc.wireless.conf
-rwxr-xr-x 1 root root 13316 Aug 19  2012 rc.wireless*
-rwxr-xr-x 1 root root   437 Oct  8  2013 rc.ulogd*
-rwxr-xr-x 1 root root  6366 Jan 18  2013 rc.udev*
-rwxr-xr-x 1 root root  1740 Sep 11  1999 rc.sysvinit*
-rw-r--r-- 1 root root  1018 Apr 25  2010 rc.sysstat
-rwxr-xr-x 1 root root   981 Jun 22  2013 rc.syslog*
-rwxr-xr-x 1 root root  1837 Dec  7  2014 rc.sshd*
-rw-r--r-- 1 root root   895 Jun  5  2013 rc.snmpd
-rw-r--r-- 1 root root  2895 Aug  7  2013 rc.serial
-rw-r--r-- 1 root root   687 Jun  4  2002 rc.sendmail
-rw-r--r-- 1 root root  1170 Jul 12  2013 rc.saslauthd
-rwxr-xr-x 1 root root   791 Oct 20  2013 rc.samba*
-rw-r--r-- 1 root root  1402 Oct 14  2008 rc.rpc
-rw-r--r-- 1 root root     0 Jun  8 23:18 rc.postfix.new
-rw-r--r-- 1 root root  1560 Jun  8 23:13 rc.postfix
-rw-r--r-- 1 root root  2334 Oct 11  2013 rc.php-fpm
-rw-r--r-- 1 root root  1722 Mar 16  2007 rc.pcmcia
-rwxr-xr-x 1 root root  1481 Apr 10 14:50 rc.ntpd*
-rw-r--r-- 1 root root  2449 May 21  2013 rc.nfsd
-rw-r--r-- 1 root root  2276 Oct 17  2013 rc.networkmanager
-rwxr-xr-x 1 root root  2764 Aug 16  2013 rc.mysqld*
-rwxr-xr-x 1 root root 35406 Oct 23  2013 rc.modules-3.10.17*
lrwxrwxrwx 1 root root    18 Jun  4 12:34 rc.modules -> rc.modules-3.10.17*
-rwxr-xr-x 1 root root  1893 Jul  9  2013 rc.messagebus*
-rwxr-xr-x 1 root root  1935 Sep 27  2010 rc.mcelog*
-rwxr-xr-x 1 root root   168 Apr 23  2011 rc.loop*
-rwxr-xr-x 1 root root   360 Jun  7 02:06 rc.local*
-rw-r--r-- 1 root root  3781 May 18  2013 rc.ip_forward
-rwxr-xr-x 1 root root   497 Sep 11  2003 rc.inetd*
-rwxr-xr-x 1 root root  4845 Aug 14  2012 rc.inet2*
-rw------- 1 root root  3888 Jun  4 14:56 rc.inet1.conf
-rwxr-xr-x 1 root root 10634 Aug  5  2012 rc.inet1*
-rwxr-xr-x 1 root root  1061 Jun  5 19:57 rc.httpd*
-rwxr-xr-x 1 root root  1156 Jun  4 14:55 rc.gpm*
-rwxr-xr-x 1 root root  1893 Jan 30  2011 rc.fuse*
-rw-r--r-- 1 root root   119 Aug 21  2012 rc.font
-rwxr-xr-x 1 root root  1474 Jun  6 23:26 rc.dovecot*
-rw-r--r-- 1 root root   512 Mar 16  2011 rc.dnsmasq
-rw-r--r-- 1 root root  4308 Oct 10  2013 rc.cups
-rwxr-xr-x 1 root root   572 Jul  7  2012 rc.consolekit*
-rwxr-xr-x 1 root root  1575 Jun  7 07:36 rc.clamav*
-rw-r--r-- 1 root root  3397 Feb 23  2013 rc.cgred
-rw-r--r-- 1 root root  4890 Feb 23  2013 rc.cgconfig
-rw-r--r-- 1 root root   393 Aug 30  2013 rc.bluetooth
-rwxr-xr-x 1 root root  3378 Jun 24  2010 rc.bind*
-rw-r--r-- 1 root root  2825 Apr 18  2013 rc.autofs
-rw-r--r-- 1 root root  2980 Sep 12  2012 rc.atalk
-rw-r--r-- 1 root root   999 Jun 22  2013 rc.alsa-oss
-rwxr-xr-x 1 root root  2556 Jun 22  2013 rc.alsa*
-rwxr-xr-x 1 root root   552 Jul 10  2013 rc.acpid*
-rwxr-xr-x 1 root root 15034 Oct 28  2013 rc.S*
-rwxr-xr-x 1 root root 11529 Oct 28  2013 rc.M*
-rwxr-xr-x 1 root root  2893 Apr 16  2011 rc.K*
-rwxr-xr-x 1 root root  7707 Sep 22  2013 rc.6*
-rwxr-xr-x 1 root root  1282 Mar 26  2007 rc.4*
lrwxrwxrwx 1 root root     4 Jun  4 12:34 rc.0 -> rc.6*
drwxr-xr-x 2 root root  4096 Sep 23  2008 init.d/

Last edited by Altiris; 06-09-2015 at 09:38 AM.
 
Old 06-09-2015, 12:14 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
-rw-r--r-- 1 root root 0 Jun 8 23:18 rc.postfix.new
-rw-r--r-- 1 root root 1560 Jun 8 23:13 rc.postfix
So it clearly shows you don't have 'x' executable permission set.

So run:

Code:
chmod u=rwx,go=rx /etc/rc.d/rc.postfix
 
Old 06-09-2015, 12:15 AM   #3
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
Heh, I used the stat command for a known working rc.* file such as rc.samba and it had 755 while rc.postfix had 644 (just type stat rc.samba for example). I chmodded rc.postfix and now it works. Time to report!
 
Old 06-09-2015, 12:24 AM   #4
JackHair
Member
 
Registered: Aug 2009
Location: Netherlands
Distribution: Slackware64-current
Posts: 167

Rep: Reputation: 39
I shouldn't leave a tab open when I'm reading other stuff. I was a little late

Last edited by JackHair; 06-09-2015 at 12:25 AM.
 
Old 06-09-2015, 06:32 AM   #5
oldtechaa
Member
 
Registered: May 2015
Location: US
Distribution: Fedora
Posts: 364

Rep: Reputation: 83
If this solved your problem, you might consider marking the thread as solved.
 
Old 06-09-2015, 09:39 AM   #6
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
So it clearly shows you don't have 'x' executable permission set.

So run:

Code:
chmod u=rwx,go=rx /etc/rc.d/rc.postfix
I didn't see this and I just did chmod 755 rc.postfix as all the other files were 755 permissions (I checked using stat) and it made it work. In the futuer if this occurs again, should I just use your chmod instead of changing it to 755?
 
Old 06-09-2015, 10:04 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Quote:
Originally Posted by Altiris View Post
I didn't see this and I just did chmod 755 rc.postfix as all the other files were 755 permissions (I checked using stat) and it made it work. In the futuer if this occurs again, should I just use your chmod instead of changing it to 755?
man chmod
 
Old 06-09-2015, 12:06 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Altiris View Post
I didn't see this and I just did chmod 755 rc.postfix as all the other files were 755 permissions (I checked using stat) and it made it work. In the futuer if this occurs again, should I just use your chmod instead of changing it to 755?
Generally, if you just need to make one of the rc scripts executable, you can do it simply using chmod +x filename as root. If this doesn't work, it is some other issue (wrong filename, not root, etc), since the command is all that is needed. There are various ways to accomplish this (as you can see in this thread and your personal usage) If you read the manpage for chmod like Didier suggested, you would start to understand the various ways to accomplish this. In this case you could use +x, a+x, ugo+x, 755, and u=rwx,go=rx all to accomplish the same thing. However, the first 3 are used to just add the execute permission, where the last 2 will specify specific permissions (in this case, rwxr-xr-x). So, it is best to understand how Linux permissions work so you don't add or remove the wrong permission to the wrong person.

However, the manpage isn't very in-depth if you're not familiar with Linux permissions, so, if you need it, the Arch wiki is a long, but in-depth page covering it.
 
Old 06-09-2015, 05:46 PM   #9
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
Generally, if you just need to make one of the rc scripts executable, you can do it simply using chmod +x filename as root. If this doesn't work, it is some other issue (wrong filename, not root, etc), since the command is all that is needed. There are various ways to accomplish this (as you can see in this thread and your personal usage) If you read the manpage for chmod like Didier suggested, you would start to understand the various ways to accomplish this. In this case you could use +x, a+x, ugo+x, 755, and u=rwx,go=rx all to accomplish the same thing. However, the first 3 are used to just add the execute permission, where the last 2 will specify specific permissions (in this case, rwxr-xr-x). So, it is best to understand how Linux permissions work so you don't add or remove the wrong permission to the wrong person.

However, the manpage isn't very in-depth if you're not familiar with Linux permissions, so, if you need it, the Arch wiki is a long, but in-depth page covering it.
I tried regular chmod +x when it was 644 and when trying to start postfix the terminal would just return. All I did then was chmod 755 and it worked right after. I understand a bit how they work, I dont know what each rwrwrw whatever is by heart, I know of a site that converts the permissions to the code which helps me understand a bit more.
 
Old 06-09-2015, 08:39 PM   #10
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Well, if you're familiar at all with binary, that's how it works here. Working from right to left, each has a value that doubles starting from 1, so the execute is 1, write is 2, and read is 4. (or if we did the rwx in number form, it's 421). So if you want read and execute, you'd add the 4 and 1 together to get 5. Add all of them for full permissions it would be 7.

As to chmod +x, there's no reason it wouldn't work unless you typed the command wrong (maybe you accidentally did a minus instead of a plus). Although it's too late now, it would've been interesting to see an ls -l of the file after you attempted the command to see what happened.
 
Old 06-11-2015, 10:28 PM   #11
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
Well, if you're familiar at all with binary, that's how it works here. Working from right to left, each has a value that doubles starting from 1, so the execute is 1, write is 2, and read is 4. (or if we did the rwx in number form, it's 421). So if you want read and execute, you'd add the 4 and 1 together to get 5. Add all of them for full permissions it would be 7.

As to chmod +x, there's no reason it wouldn't work unless you typed the command wrong (maybe you accidentally did a minus instead of a plus). Although it's too late now, it would've been interesting to see an ls -l of the file after you attempted the command to see what happened.
I can still do it again if you'd like I am just messing with some stuff. Ill do it again and report back.

EDIT: Alright here we go, recompiled postfix and I made sure to remove postfix using slackpkg as well as the rc. file I put samba as an example as that was installed by default during installation

Code:
-rwxr-xr-x 1 root root   791 Oct 20  2013 rc.samba*
-rw-r--r-- 1 root root  1560 Jun 11 23:31 rc.postfix
Running /etc/rc.d/rc.postfix start gives me permission denied as it did before.

Now I tried chmod u=rwx,go=rx /etc/rc.d/rc.postfix

Code:
-rwxr-xr-x 1 root root   791 Oct 20  2013 rc.samba*
-rwxr-xr-x 1 root root  1560 Jun 11 23:31 rc.postfix*
Now lets try it again, and what do you know it works. So I guess I missed something? I know for sure I didnt do - instead of + I remember seeing that. I didnt try Now I tried chmod u=rwx,go=rx /etc/rc.d/rc.postfix before but only chmod +x rc.postfix

Last edited by Altiris; 06-11-2015 at 10:37 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission denied /var/lib/postfix/master.lock error landysaccount Linux - Newbie 4 01-26-2013 01:29 PM
file permission denied, install postfix aw_wolfe Linux - Newbie 7 07-13-2011 07:27 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM
postfix mailbox permission denied hua Linux - Enterprise 3 11-14-2006 09:05 AM
Postfix-MySQL-Courier IMAP - Permission denied abapdr Linux - Software 0 06-24-2004 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration