[SOLVED] Why is postgrey complaining about no pid file?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# Need to run postgrey as anything other than root. Use nobody account by
# default. Change this to whatever user you want.
So I just left it as nogroup/nouser as I didn't want to mess with that as this is my first time running this software. Looking at /var/run/postgrey and /var/lib/postgrey, the permissions are that they are owned by "nobody" and "nogroup". Should I remove postgrey, make a group and user called postgrey, compile/install again? Or just leave it as default? If I do, what UID and group ID do I use?
Are you supposed to add a USER and GROUP name? Because I'm not seeing where these would otherwise be set.
Code:
USER=%POSTGREYUSR%
GROUP=%POSTGREYGRP%
Looking more carefully at the SlackBuild, it seems it didn't finish properly (or you didn't use it), because there are sed lines to replace the user and group with the ones specified in the SlackBuild.
Where they're set:
Code:
# Need to run postgrey as anything other than root. Use nobody account by
# default. Change this to whatever user you want.
POSTGREYUSR=${POSTGREYUSR:-nobody}
POSTGREYGRP=${POSTGREYGRP:-nogroup}
POSTGREYUID=${POSTGREYUID:-98}
POSTGREYGID=${POSTGREYGID:-99}
And where the rc.postgrey is changed:
Code:
sed -e s/%POSTGREYUSR%/$POSTGREYUSR/g \
-e s/%POSTGREYGRP%/$POSTGREYGRP/g \
$CWD/rc.postgrey > $PKG/etc/rc.d/rc.postgrey.new
TL;DNR
Most likely, you can change the lines in your rc.postgrey to read:
# Need to run postgrey as anything other than root. Use nobody account by
# default. Change this to whatever user you want.
So I just left it as nogroup/nouser as I didn't want to mess with that as this is my first time running this software. Looking at /var/run/postgrey and /var/lib/postgrey, the permissions are that they are owned by "nobody" and "nogroup". Should I remove postgrey, make a group and user called postgrey, compile/install again? Or just leave it as default? If I do, what UID and group ID do I use?
No that's fine. The shell construct below tells you the slackbuild will use custom $POSTGREYUSR and $POSTGREYGRP values only if you defined them beforehand. If you did not do so then it will default to nobody and nogroup instead.
Code:
# Need to run postgrey as anything other than root. Use nobody account by
# default. Change this to whatever user you want.
POSTGREYUSR=${POSTGREYUSR:-nobody}
POSTGREYGRP=${POSTGREYGRP:-nogroup}
Are you supposed to add a USER and GROUP name? Because I'm not seeing where these would otherwise be set.
Code:
USER=%POSTGREYUSR%
GROUP=%POSTGREYGRP%
Looking more carefully at the SlackBuild, it seems it didn't finish properly (or you didn't use it), because there are sed lines to replace the user and group with the ones specified in the SlackBuild.
Where they're set:
Code:
# Need to run postgrey as anything other than root. Use nobody account by
# default. Change this to whatever user you want.
POSTGREYUSR=${POSTGREYUSR:-nobody}
POSTGREYGRP=${POSTGREYGRP:-nogroup}
POSTGREYUID=${POSTGREYUID:-98}
POSTGREYGID=${POSTGREYGID:-99}
And where the rc.postgrey is changed:
Code:
sed -e s/%POSTGREYUSR%/$POSTGREYUSR/g \
-e s/%POSTGREYGRP%/$POSTGREYGRP/g \
$CWD/rc.postgrey > $PKG/etc/rc.d/rc.postgrey.new
TL;DNR
Most likely, you can change the lines in your rc.postgrey to read:
Code:
USER=nobody
GROUP=nogroup
Hmm I am not sure, the rc.postgrey is showing %POSTGREYUSR% ..I don't know a lot about bash or whatever language this is but to me that it appears its trying to call something
that was already defined, I am assuming when it was compiled? I am going to uninstall it and compile it with the changes you suggested making in the SlackBuild, though I have to ask one thing, what is
Again, that's a shell construct: it means the UID and GID variables will fall back on these preset values of 98 and 99 if you haven't explicitly set them otherwise.
@gezley, those variables are changed in the rc.postgrey file during the SlackBuild process. If they're still showing %POSTGREYUSR% and %POSTGREYGRP%, it means that the sed line wasn't processed in the SlackBuild to change it. According to the output from Altrius, those entries were never changed, which means he either didn't use the SlackBuild and just grabbed the files or the SlackBuild didn't execute properly.
@Altrius, you need to change them to the username/group, not the UID/GID. If you want them to be configurable by passing variables, you'd need them to be:
Again, that's a shell construct: it means the UID and GID variables will fall back on these preset values of 98 and 99 if you haven't explicitly set them otherwise.
I think I understand. Late reply but, I removed postgrey, and made a postgrey user and group using the commands
You really should use the SlackBuild, as that sets everything up for this to run properly.
Your issue now is that the user doesn't have access to the directory to create the pid file. That directory is created in the SlackBuild and chown'd to the user specified further up in the SlackBuild.
There's also /var/lib/postgrey/ created and chown'd in the SlackBuild that will need to be done as well.
Since I'd recommend you using the SlackBuild, if you want to keep the postgrey user/group, just run the following.
However, it'd be fine to just keep using the default user "nobody" and the default group "nogroup" (which means you could just run the SlackBuild without all the extra options). I don't think this program warrants having it's own user (but that's solely up to you). You just shouldn't run the program as root, so they picked the nobody account, which is created by default on Slackware.
Last edited by bassmadrigal; 08-06-2016 at 11:55 PM.
You really should use the SlackBuild, as that sets everything up for this to run properly.
Your issue now is that the user doesn't have access to the directory to create the pid file. That directory is created in the SlackBuild and chown'd to the user specified further up in the SlackBuild.
There's also /var/lib/postgrey/ created and chown'd in the SlackBuild that will need to be done as well.
Since I'd recommend you using the SlackBuild, if you want to keep the postgrey user/group, just run the following.
However, it'd be fine to just keep using the default user "nobody" and the default group "nogroup" (which means you could just run the SlackBuild without all the extra options). I don't think this program warrants having it's own user (but that's solely up to you). You just shouldn't run the program as root, so they picked the nobody account, which is created by default on Slackware.
Okay I am completely confused now. I am using the slackbuild, I always was using the slackbuild. I first compiled postgrey with all of the default options in the postgrey.Slackbuild and I had the pid file error. That is when I then tried to create a specific user and group by editing the postgrey.Slackbuild to see if that would get rid of the pid error, but it didn't. So now I am sort of stuck with what I should do. What you are telling me to paste into the terminal is what I already did by manually editing the postgrey.SlackBuild ....it shouldn't be any different right or should I try it again? I am just wondering why it keeps complaining about the pid file, even if I use a custom user or nobody/nogroup. I am going to do as you say though and just use the default configuration from the Slackbuild, though I am still going to have that pid error I think.
Well then something is really screwy. I'm not sure if it is with the SlackBuild or your computer, and I don't have time to test the SlackBuild right now. As a quick and dirty fix, change the rc.postgrey to USER=nobody and GROUP=nogroup and then make sure /var/lib/postgrey/ and /var/run/postgrey/ folders are created and owned by nobody:nogroup. That should allow you to start the daemon assuming nothing else is screwed up.
If you haven't cleared your package source and packaging directories, can you post the file /tmp/SBo/package-postgrey/etc/rc.d/rc.postgrey.new ?
Well then something is really screwy. I'm not sure if it is with the SlackBuild or your computer, and I don't have time to test the SlackBuild right now. As a quick and dirty fix, change the rc.postgrey to USER=nobody and GROUP=nogroup and then make sure /var/lib/postgrey/ and /var/run/postgrey/ folders are created and owned by nobody:nogroup. That should allow you to start the daemon assuming nothing else is screwed up.
If you haven't cleared your package source and packaging directories, can you post the file /tmp/SBo/package-postgrey/etc/rc.d/rc.postgrey.new ?
I apologize again for the late reply, went to sleep. I have no clue either, I doubt it could be the SlackBuild as these things are normally tested, but who knows. I will do as you say for the quick and dirty fix, and sure I can send you the rc.postgrey.new file
..However, /tmp/SBo/package-postgrey/etc/rc.d/rc.postgrey.new does not exist. I have /tmp/SBo/postgrey and inside that I have
Uhhh so I think you might hate me for this. I had been working on this last night stopping and starting....I forgot that I had made an alteration to the rc.postgrey, which included this --delay=60 that I added I completely forgot that I had added it in.....I used the new rc.postgrey.new (renamed to rc.postgrey) which did not have the --delay=60 option set and now it starts perfectly fine...lol sorry. Now I need to figure out how to change that delay to 60 as I do not want 300 as it is too long.
Figured out how to add the delay, I need a \ sign ...guess that's what I get for using a transparent terminal emulator, things are hard to see.
As for the /tmp/SBo/package-postgrey/ directory, that should be created when the make install occurs with the SlackBuild. Unless you have something clear the tmp directories after a build, it should exist as that is the directory that makepkg is called from.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.