1 |
On 06/05/2016 03:23 AM, J. García wrote: |
2 |
> I run systemd , but I have not tested your script, as of now I'm not |
3 |
> using spamassassin, but I will at some time in near future; but looking |
4 |
> at the script, I see some problems, you run the OpenRC restart commands |
5 |
> even if systemd is available, further it doesn't know which one is |
6 |
> running, as both can be installed(And are installed if using systemd), |
7 |
|
8 |
That's what the "/etc/init.d/spamd status" command is meant to check. |
9 |
The "... status" will only return success if you are running spamd via |
10 |
openrc. Likewise, as I understand it (but haven't tested), the |
11 |
"systemctl try-restart spamassassin" command will only work if you are |
12 |
*using* systemd and the spamassassin service is running. They should be |
13 |
harmless otherwise. |
14 |
|
15 |
For example... |
16 |
|
17 |
# spamd --daemonize |
18 |
# /etc/init.d/spamd status |
19 |
* status: stopped |
20 |
# echo $? |
21 |
3 |
22 |
|
23 |
If on the first line I had done "systemctl start spamassassin.service", |
24 |
I should get the same result, so the openrc reload commands will be |
25 |
skipped for systemd users. |
26 |
|
27 |
I did take your suggestion and check for rc-service though. I shouldn't |
28 |
count on openrc being in @system forever. |