Re: Custom systemctl service issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 10, 2024, at 16:14, Ricardo wrote:

On a custom systemctl service, when start service it seems starting without any message, but when it check by journalctl command it reporter as Failure.

But if manually run service program it starts without any problem and message.

The bellow is program to execute as service, which have work without any problems on previous linux service.

# asterisk

# asterisk -rx "core stop now"


# systemctl start asterisk.service


This only issues a request to start the service; it does not actually wait for the service to start, or report on the results of the start request.

#

# journalctl -xe |grep asterisk

-- Subject: Unit asterisk.service has finished start-up

-- Unit asterisk.service has finished starting up.

Mar 10 10:20:15 localhost.localdomain asterisk[1536]: ASTdb initialization failed. ASTERISK EXITING!

Mar 10 10:20:15 localhost.localdomain asterisk[1536]: Unable to open Asterisk database '/var/lib/asterisk/astdb.sqlite3': unable to open database file

Mar 10 10:20:15 localhost.localdomain systemd[1]: asterisk.service: main process exited, code=exited, status=1/FAILURE

Mar 10 10:20:15 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.

Mar 10 10:20:15 localhost.localdomain systemd[1]: asterisk.service failed.


The program was unable to access it database, likely due to the configuration in the .service file. It may be running as the wrong user/group, or have filesystem protection settings which disallow access to /var/lib/asterisk, or possibly other things. Running the program manually would not have the same restrictions in place, even if it is run as the proper user and group.

Check the asterisk.service file, in particular the [Service] section, to see if there are any sandboxing restrictions being placed on the service.


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux