Menu

#158 exit code on restart

ASSP V2
closed
None
2025-10-16
2025-05-21
ViceIce
No

ASSP is always exiting with code 1, so it's always counted as error from my systemd service.

Would it be possible to exit with code 0 on success, like exit for restart?

Discussion

  • ViceIce

    ViceIce - 2025-05-21

    Probably related to this error:

    [Worker_10000] BerkeleyDB-CRT-ENV-ERROR (1) in HASH Griplist , on file /usr/share/assp/griplist.bdb : BDB:Permission denied
    2025-05-21 06:56:42 [Worker_10000] BerkeleyDB-ENV-ERROR Griplist:  - BDB:Permission denied
    

    This file always seems to have wrong permissions after startup.

    $ ll /usr/share/assp/griplist.bdb
    -rw-r--r-- 1 root assp 5517312 May 21 07:21 /usr/share/assp/griplist.bdb
    
     
  • ViceIce

    ViceIce - 2025-05-21

    ASSP version 2.8.2(25098) (Perl 5.034000) (on linux)

     
  • ViceIce

    ViceIce - 2025-05-21

    Probably related to useDB4griplist which i've enabled. Can i use DB: for griplist option instead, so it's using my mariadb server?

     

    Last edit: ViceIce 2025-05-21
  • Thomas Eckardt

    Thomas Eckardt - 2025-05-21
    • status: open --> accepted
    • assigned_to: Thomas Eckardt
     
  • Thomas Eckardt

    Thomas Eckardt - 2025-05-21

    If assp is running under systemd control - start and stop assp using systemd!
    If assp is under systemd control, exit code 1 is returned - because assp is unable to detect
    from where INT/TERM/KILL/... was sent. It is assumed that systemd will not restart assp, if it has
    requested a service stop - in every other case it is assumed, that systemd will know what to do!

    You can't use DB: for griplist - RTM!

    assp uses the default BerkeleyDB file permission, which is -rw-rw-rw- (0666) on linux/nix
    the file permission is not explicit defined at DB creation time by assp and never set to 0644 at any time.
    I'm unable to reproduce this issue!

    Thomas

     
  • ViceIce

    ViceIce - 2025-05-21

    ok, I configured AsADaemon to yes - externally controlled and my service looks like this:

    [Unit]
    Description=Anti-Spam SMTP Proxy Server daemon
    After=network-online.target mariadb.service clamav-daemon.service
    Wants=network-online.target
    BindsTo=mariadb.service clamav-daemon.service
    
    [Service]
    Type=forking
    WorkingDirectory=/usr/share/assp
    ExecStart=/usr/bin/perl assp.pl
    ExecStop=/usr/bin/kill $MAINPID
    PIDFile=/usr/share/assp/pid
    Restart=always
    RestartSec=30s
    TimeoutStartSec=2min
    TimeoutStopSec=3min
    
    [Install]
    WantedBy=multi-user.target
    

    is there something wrong with this? should i configure the user and group via the service file instead of assp options?

    How can i tell assp to shutdown when not using the above kill method?

     
  • Thomas Eckardt

    Thomas Eckardt - 2025-10-16
    • status: accepted --> closed
     
    😕
    1

Log in to post a comment.

MongoDB Logo MongoDB