Code Monkey home page Code Monkey logo

Comments (24)

roehling avatar roehling commented on May 31, 2024

Unfortunately, I have no systemd installed to replicate the problem. Would it be possible for you to do some debugging and post a more detailed log?

from postsrsd.

 avatar commented on May 31, 2024

Do you think it could be due to missing init functions? I've tried calling "status" directly and here's how it failed: http://pastebin.com/znQjKR0W
If you want I can set up a box with a OpenSuSE setup and send you access credentials, to help you debugging this.
Thanks

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Uhm systemd doesn't use /etc/init.d/ anymore, use systemctl

you can create the file /etc/systemd/system/postsrsd.service

Description=PostSRSd Daemon
After=network.target

[Service]
Type=simple
EnvironmentFile=/etc/conf.d/postsrsd
ExecStart=/usr/local/sbin/postsrsd -4 -f${SRS_FORWARD_PORT} -r${SRS_REVERSE_PORT} -d${SRS_DOMAIN} -s${SRS_SECRET} -u${SRS_RUN_AS} -c${SRS_CHROOT} -X${SRS_EXCLUDE_DOMAINS}
Restart=always

[Install]
WantedBy=postfix.service

given that you have a postfix.service (you can check by systemctl status postfix.service)

then you should enable the service systemctl enable postsrsd.service and start it systemctl start postsrsd.service

when you reboot, postsrsd will be automatically started when postfix starts.

from postsrsd.

 avatar commented on May 31, 2024

I've tried this and I've also added the environment variables into the file, all it does is flapping then failing: http://pastebin.com/WV8Hv81a

Hardcoding the parameters into the ExecStart= doesn't help either

Thanks

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Is postsrsd installed in /usr/local/sbin/ ?
Did you do a systemctl daemon-reload ?

from postsrsd.

 avatar commented on May 31, 2024

Yes to both. As you can see it's running when launched manually. It just fails when launched from systemctl for some reason... not much in the journalctl logs
nobody 21089 0.0 0.2 2152 316 ? S 19:33 0:00 /usr/local/sbin/postsrsd -4 -f 10001 -r 10002 -d company.com -s /etc/postsrsd.secret -u nobody -D

from postsrsd.

 avatar commented on May 31, 2024

Looks like it exits on start? Maybe it's something trivial I'm missing.

Active: failed (Result: start-limit) since Mon 2014-10-13 19:32:28 UTC; 12min ago Process: 21055 ExecStart=/usr/local/sbin/postsrsd -4 -f 10001 -r 10002 -d company.com -s /etc/postsrsd.secret -u nobody -D (code=exited, status=0/SUCCESS) Main PID: 21055 (code=exited, status=0/SUCCESS)

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Don't use -D in systemd, postsrsd will fork then and systemd will assume it exited. Or set Type to forking

Make sure you killed all previous processes you started killall -9 postsrsd

from postsrsd.

 avatar commented on May 31, 2024

Bingo! That did the trick. Thanks a lot.
Loaded: loaded (/etc/systemd/system/postsrsd.service; disabled) Active: active (running) since Mon 2014-10-13 23:49:44 UTC; 4min 44s ago
I think all that is needed now is to check with a if(USE_SYSTEMD) or something similar in the makefile, so that the makefile/postinstall can go ahead and install() the environment file in /etc/postsrsd.d/ (SuSE doesn't seem to have a generic conf.d/) and the systemd unit in the appropriate directory.
I'm no programmer so I don't really know how to perform that check, not much luck by looking at other sources. Right now it's all working though.
Thanks again!

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Indeed, the conf.d is my personal creation. We could really add a postsrsd service file for systemd. The automatic installation will be done by the package maintainers anyways and postsrsd is not available in your distro, then you should be able to install the service file yourself.

from postsrsd.

 avatar commented on May 31, 2024

Yeah, but as you can see there's already support for upstart and other init
systems in the current makefile, so why not extend it to systemd too if
present? This way the unit file will be installed on a "make install", as
it happens now on standard init.
I'm not sure about what distros ship with postsrsd in the repos anyway - we
should open packaging requests maybe?

On 14 October 2014 11:33, bjoe2k4 [email protected] wrote:

Indeed, the conf.d is my personal creation. We could really add a postsrsd
service file for systemd. The automatic installation will be done by the
package maintainers anyways and postsrsd is not available in your distro,
then you should be able to install the service file yourself.


Reply to this email directly or view it on GitHub
#19 (comment).

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

working on a pull request ...

from postsrsd.

 avatar commented on May 31, 2024

I will be more than happy to test it.

Thanks

On Wednesday, October 15, 2014, bjoe2k4 [email protected] wrote:

working on a pull request ...


Reply to this email directly or view it on GitHub
#19 (comment).

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Please try bjoe2k4@61358073293d0f8bf8df4c9624c2db3ddaad76c7

from postsrsd.

 avatar commented on May 31, 2024

Hmm, by default it's not working, all I get is:

Oct 15 18:13:57 mail1 systemd[1]: postsrsd.service: control process exited,
code=exited status=1
Oct 15 18:13:57 mail1 systemd[1]: Failed to start LSB: Start/stop the
postsrsd daemon.

I've tried moving the .in file to the systemd/system dir but no luck. I've
also configured the file in /etc/default.

Any hints? As I said, if any of you needs a OpenSUSE box to test things
just ask.

Thanks

On 15 October 2014 20:04, bjoe2k4 [email protected] wrote:

Please try bjoe2k4@6135807
https://github.com/bjoe2k4/postsrsd/commit/61358073293d0f8bf8df4c9624c2db3ddaad76c7


Reply to this email directly or view it on GitHub
#19 (comment).

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Try this, i think some path was wrong. bjoe2k4@62840f40ca4d080028ccbbb38f0c3e64cafd1ac8

from postsrsd.

 avatar commented on May 31, 2024

Confirmed working on OpenSUSE 13.1.

Thanks a lot!

On 15 October 2014 21:40, bjoe2k4 [email protected] wrote:

Try this, i think some path was wrong. bjoe2k4@62840f4
https://github.com/bjoe2k4/postsrsd/commit/62840f40ca4d080028ccbbb38f0c3e64cafd1ac8


Reply to this email directly or view it on GitHub
#19 (comment).

from postsrsd.

amiga600 avatar amiga600 commented on May 31, 2024

Same problem on Centos 7. :-( Postsrsd doesn't start on boot.

[root@cent7 log]# systemctl status postsrsd.service
postsrsd.service - PostSRSd Daemon
   Loaded: loaded (/etc/systemd/system/postsrsd.service; enabled)
   Active: failed (Result: start-limit) since Út 2015-01-06 10:33:05 CET; 58min ago
  Process: 1201 ExecStart=/usr/local/sbin/postsrsd -f${SRS_FORWARD_PORT} -r${SRS_REVERSE_PORT} -d${SRS_DOMAIN} -s${SRS_SECRET} -u${RUN_AS} -c${CHROOT} -X${SRS_EXCLUDE_DOMAINS} (code=exited, status=1/FAILURE)
 Main PID: 1201 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/postsrsd.service

led 06 10:33:05 cent7.example.com systemd[1]: postsrsd.service: main process exited, code=exited, status=1/FAILURE
led 06 10:33:05 cent7.example.com systemd[1]: Unit postsrsd.service entered failed state.
led 06 10:33:05 cent7.example.com systemd[1]: postsrsd.service holdoff time over, scheduling restart.
led 06 10:33:05 cent7.example.com systemd[1]: Stopping PostSRSd Daemon...
led 06 10:33:05 cent7.example.com systemd[1]: Starting PostSRSd Daemon...
led 06 10:33:05 cent7.example.com systemd[1]: postsrsd.service start request repeated too quickly, refusing to start.
led 06 10:33:05 cent7.example.com systemd[1]: Failed to start PostSRSd Daemon.
led 06 10:33:05 cent7.example.com systemd[1]: Unit postsrsd.service entered failed state.
[root@cent7 log]# cat messages | grep postsrsd | grep 10:33
Jan  6 10:33:04 cent7 postsrsd: postsrsd: bind_service(10001): Name or service not known
Jan  6 10:33:04 cent7 systemd: postsrsd.service: main process exited, code=exited, status=1/FAILURE
Jan  6 10:33:04 cent7 systemd: Unit postsrsd.service entered failed state.
Jan  6 10:33:04 cent7 systemd: postsrsd.service holdoff time over, scheduling restart.
Jan  6 10:33:04 cent7 postsrsd: postsrsd: bind_service(10001): Name or service not known
Jan  6 10:33:04 cent7 systemd: postsrsd.service: main process exited, code=exited, status=1/FAILURE
Jan  6 10:33:04 cent7 systemd: Unit postsrsd.service entered failed state.
Jan  6 10:33:05 cent7 systemd: postsrsd.service holdoff time over, scheduling restart.
Jan  6 10:33:05 cent7 postsrsd: postsrsd: bind_service(10001): Name or service not known
Jan  6 10:33:05 cent7 systemd: postsrsd.service: main process exited, code=exited, status=1/FAILURE
Jan  6 10:33:05 cent7 systemd: Unit postsrsd.service entered failed state.
Jan  6 10:33:05 cent7 systemd: postsrsd.service holdoff time over, scheduling restart.
Jan  6 10:33:05 cent7 postsrsd: postsrsd: bind_service(10001): Name or service not known
Jan  6 10:33:05 cent7 systemd: postsrsd.service: main process exited, code=exited, status=1/FAILURE
Jan  6 10:33:05 cent7 systemd: Unit postsrsd.service entered failed state.
Jan  6 10:33:05 cent7 systemd: postsrsd.service holdoff time over, scheduling restart.
Jan  6 10:33:05 cent7 postsrsd: postsrsd: bind_service(10001): Name or service not known
Jan  6 10:33:05 cent7 systemd: postsrsd.service: main process exited, code=exited, status=1/FAILURE
Jan  6 10:33:05 cent7 systemd: Unit postsrsd.service entered failed state.
Jan  6 10:33:05 cent7 systemd: postsrsd.service holdoff time over, scheduling restart.
Jan  6 10:33:05 cent7 systemd: postsrsd.service start request repeated too quickly, refusing to start.
Jan  6 10:33:05 cent7 systemd: Unit postsrsd.service entered failed state.

Starting it manually works just perfect.

[root@cent7 log]# systemctl start postsrsd.service
[root@cent7 log]# systemctl status postsrsd.service
postsrsd.service - PostSRSd Daemon
   Loaded: loaded (/etc/systemd/system/postsrsd.service; enabled)
   Active: active (running) since Út 2015-01-06 11:32:28 CET; 6s ago
 Main PID: 2469 (postsrsd)
   CGroup: /system.slice/postsrsd.service
           └─2469 /usr/local/sbin/postsrsd -f10001 -r10002 -dcent7.example.com -s/etc/postsrsd.secret -unobody -c/usr/local/lib/postsrsd -X

led 06 11:32:28 cent7.example.com systemd[1]: Started PostSRSd Daemon.

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Your postsrsd attempts to start before the loopback? interface is up (not sure if this can actually be the case?). Systemd tries to restart it up to 5 times within 10s (default) and enters failed state. There are numerous ways to resolve this, the easiest one is the following:

  • Add RestartSec=1s to /etc/systemd/system/postsrsd.service in the [Service] section. You will still get one failed attempt at boot.

from postsrsd.

amiga600 avatar amiga600 commented on May 31, 2024

bjoe2k4: There is a Network Manager in Centos and I tried to disable it (NM_CONTROLLED="no"). And now? Postsrsd.service starts without any problems. :) There was something wrong with this NM... Thanks for the clue!

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

Also useful: http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

from postsrsd.

amiga600 avatar amiga600 commented on May 31, 2024

bjoe2k4: Very useful, Thanks 👍 Now Postsrsd.service starts in Centos 7 with enabled Network Manager.

systemctl enable NetworkManager-wait-online.service

from postsrsd.

bjoe2k4 avatar bjoe2k4 commented on May 31, 2024

I think this issue is finally resolved with b161cb4 and can be closed.

from postsrsd.

roehling avatar roehling commented on May 31, 2024

Agreed, I will close this for now.

from postsrsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.