Action command for Linux stop service

Hi All,

any help to stop or start the service on linux platform using bigfix action command

Thanks,
Nagaraj.

you have to use rest api to fire the action or stop it.

using bigfix action any possibility to do this ?

Greetings.

You can start, stop and restart Linux services by creating a custom task to do so. I have one that is simply a shell script that restarts Apache:

You can also wrap this into action script like so:

delete __appendfile

appendfile #!/bin/sh
appendfile service httpd restart

//modify appendfile to allow execution
wait chmod 555 "{(client folder of current site as string) & “/__appendfile”}

//execute shell script as written
wait “{(client folder of current site as string) & “/__appendfile”}”

Or you can simply do this:

wait service httpd restart

1 Like

Thanks for the updates and i am getting permission set error like below

Completed delete __appendfile
Completed appendfile #!/bin/sh
Completed appendfile service firewalld restart
Completed //modify appendfile to allow execution
Failed wait chmod 555 "{(client folder of current site as string) & “/__appendfile”}
//execute shell script as written
wait “{(client folder of current site as string) & “/__appendfile”}”

I have changed the permission 755 for __appendfile and working fine.

Completed delete __appendfile
Completed appendfile #!/bin/sh
Completed appendfile service firewalld restart
Completed //modify appendfile to allow execution
Completed wait chmod 755 "{(client folder of current site as string) & “/__appendfile”}
//execute shell script as written
completed wait “{(client folder of current site as string) & “/__appendfile”}”

Be aware that on some hardened systems you cannot +x any file in /var so in that case you could /bin/sh __appendfile and just run the file. Note you don’t need the client folder as that is the current directory.

1 Like