如何使用system start运行软件-ubuntu

如何使用system start运行软件-ubuntu,ubuntu,cron,ps,Ubuntu,Cron,Ps,我无法在系统启动时设置运行软件。我有ubuntu 20.04。我试图将这些行插入etc/rc.local #!/bin/bash /usr/bin/clamonacc 它不起作用。第二次尝试是像这样将其插入到cron: @reboot /usr/bin/clamonacc 它也不起作用。我正试图通过这个命令来检查这一点 ps -e | grep 'clam*' 在输出中,与clamonacc无关。如果我以root用户身份手动运行它,它可以正常工作,并且我可以在ps中找到正在运行的进程。有人

我无法在系统启动时设置运行软件。我有ubuntu 20.04。我试图将这些行插入etc/rc.local

#!/bin/bash
/usr/bin/clamonacc
它不起作用。第二次尝试是像这样将其插入到cron:

@reboot /usr/bin/clamonacc
它也不起作用。我正试图通过这个命令来检查这一点

ps -e | grep 'clam*'
在输出中,与clamonacc无关。如果我以root用户身份手动运行它,它可以正常工作,并且我可以在ps中找到正在运行的进程。有人可以帮助我如何调试它吗?问题在哪里?提前感谢

来自,链接到clamav的详细介绍:

# /etc/systemd/system/clamonacc.service
[Unit]
Description=ClamAV On Access Scanner
Requires=clamav-daemon.service
After=clamav-daemon.service syslog.target network.target

[Service]
Type=simple
User=root
ExecStartPre=/bin/bash -c "while [ ! -S /var/run/clamav/clamd.ctl ]; do sleep 
1; done"
ExecStart=/usr/bin/clamonacc -F --config-file=/etc/clamav/clamd.conf 
--log=/var/log/clamav/clamonacc.log --move=/root/quarantine

[Install]
WantedBy=multi-user.target

我不确定所提到的目录是否正确-我宁愿选择/etc/systemd/system/multi-user.target.wants,clamd服务所在的位置(至少在我的安装上)。

可能会重新向ak提出关于clamonacc的问题?