startup script amavisd_init.sh not working

Alexander Azeev artang89 at gmail.com
Fri Jan 18 12:35:46 CET 2019


Hello, I'm using Ubuntu 18.04.1 LTS.
I am kind of noob as far as Linux goes.
I installed amavisd-new-2.11.1 from the website.
It works and starts ok manually, but not on startup.

I put amavisd_init.sh in /etc/init.d/
I guess it has to be edited, but I don't really know how exactly.

Here are the parts of amavisd_init.sh that I have already edited:

#. /etc/rc.d/init.d/functions
. /lib/lsb/init-functions

# Source networking configuration.
#. /etc/sysconfig/network
. /etc/network/interfaces

#prog="/opt/amavisd-new/sbin/amavisd"
#prog="/usr/sbin/amavisd"
prog="/usr/local/sbin/amavisd"
prog_base="$(basename ${prog})"

I don't really understand what am I supposed to write at # Source
configuration.

If I use [ -e /etc/sysconfig/${prog_base} ] && .
/etc/sysconfig/${prog_base}
or [ -e /etc/default/${prog_base} ] && . /etc/default/${prog_base}
then the scripts shows this error:

sudo /etc/init.d/amavisd_init.sh start
[....] Starting amavisd_init.sh (via systemctl): amavisd_init.serviceJob
for amavisd_init.service failed because the control process exited with
error code.
See "systemctl status amavisd_init.service" and "journalctl -xe" for
details.
 failed!

 journalctl -xe
-- Subject: Unit amavisd_init.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit amavisd_init.service has begun starting up.
Jan 18 09:07:25 ubuntu-test-04 amavisd_init.sh[23247]:
/etc/init.d/amavisd_init.sh: 41: /etc/init.d/amavisd_init.sh: action: not
found
Jan 18 09:07:25 ubuntu-test-04 systemd[1]: amavisd_init.service: Control
process exited, code=exited status=127
Jan 18 09:07:25 ubuntu-test-04 systemd[1]: amavisd_init.service: Failed
with result 'exit-code'.
Jan 18 09:07:25 ubuntu-test-04 systemd[1]: Failed to start SYSV: amavisd is
an interface between MTA and content checkers.
-- Subject: Unit amavisd_init.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit amavisd_init.service has failed.
--
-- The result is RESULT.


I also tried using [ -e /usr/local/sbin/${prog_base} ] && .
/usr/local/sbin/${prog_base}:

Jan 18 09:14:11 ubuntu-test-04 amavisd_init.sh[23532]:
/etc/init.d/amavisd_init.sh: 135: /usr/local/sbin/amavisd: BEGIN: not found
Jan 18 09:14:11 ubuntu-test-04 amavisd_init.sh[23532]:
/etc/init.d/amavisd_init.sh: 136: /usr/local/sbin/amavisd: Syntax error:
"(" unexpected
Jan 18 09:14:11 ubuntu-test-04 systemd[1]: amavisd_init.service: Control
process exited, code=exited status=2
Jan 18 09:14:11 ubuntu-test-04 systemd[1]: amavisd_init.service: Failed
with result 'exit-code'.
Jan 18 09:14:11 ubuntu-test-04 systemd[1]: Failed to start SYSV: amavisd is
an interface between MTA and content checkers.


-- 
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.amavis.org/pipermail/amavis-users/attachments/20190118/47d56486/attachment.html>


More information about the amavis-users mailing list