0

I have a custom service (I did not create it) that stops multiple services. The server currently uses upstart, and I need to migrate to systemd. I discovered from this question that I cannot use custom events with systemd, so this is an issue. A developer created many custom upstart scripts, and several use custom initctl emit commands. I've been tasked with migrating them. Some of the basics are fine, but it's where it gets into the custom commands that throws me off.

Upstart:

description "Stop all custom services on this server"

console log

start on custom-stop-all <--- Definitely not sure on this one

script
    declare -a events=("fax-stop" "voice-stop" "file-stop" "text-stop" "delayed-stop" "email-stop" "push-stop" "image-stop" "dns-stop" "ssl-cert-stop" )

    for type in "${events[@]}"
    do
        initctl emit $type
    done
end script

If I understand correctly, I cannot use script and end script, and would have to use ExecStart=/path/to/bash/script. So, I am unsure on how to use the systemd version of custom-stop-all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.