服务启动时无法使用mysql

服务启动时无法使用mysql

我遇到了一个奇怪的错误。我已经设置了 Postfix 和 ASSP,ASSP 使用 mysql 数据库,一切正常。如果我运行 perl assp.pl,就不用担心了,生活很美好。

但是如果我将 assp 设置为作为服务运行(以便它自动启动),它确实启动了,但是没有任何表被导入,它要么无权访问 perl,要么无权访问 mysql...

我尝试提升权限,几乎我所能想到的所有方法...这可能是什么原因造成的?

/etc/systemd/system/assp.service

[Unit]
Description=AntiSpam SMTP Proxy
After=mysql.service network.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/perl /var/db/assp/assp.pl /var/db/assp/
ExecStop=/usr/bin/killall /usr/bin/perl
User=root
[Install]
WantedBy=multi-user.target

如有任何建议我将非常感激:)

启动日志 启动日志确实显示了错误。但我不确定这是 perl 还是 mysql 权限错误。

Jul-06-21 00:52:41 [Worker_10001] Whitelist database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Persblack database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Redlist database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Delaydb database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Delaydb.white database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Pbdb.white.db database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Pbdb.black.db database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63.
Jul-06-21 00:52:41 [Worker_10001] Pbdb.rbl.db database error: Can't locate object method "connect" via package "DBI" at sub main::checkDBCon line 63

相关内容