Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Description: I have a simple Python script that tries to check whether ClamAV is "inactive" in the container and if it is then it attempts to start it using 
    <pre lang="Python">import os 
        os.popen("systemctl start clamav-freshclam.service")
        os.popen("systemctl start clamav-daemon")

However this always results in a
Python
FileNotFoundError: systemctl clamav-daemon file not found.
Here's the tricky part - When I start a Python console inside the container and write this same code, it ends up starting the service - both the freshclam and daemon. What am I missing here?

What I have tried:

I have written the script and tried to execute the command which works from the container python shell, with no luck.
Posted
Comments
Richard MacCutchan 5-Apr-23 12:29pm    
Which part is failing? When you run it inside the container, or from a command window?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900