How to run a command in power up or shutdown (NOT reboot)?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have some EC2 instances and I wanted to run a command whenever an instance is created or terminated. Some of the solutions that AWS offers are not very simple (like using SNS topics and using lifecycle hooks), so they are not an option for me.
One my options was running a script in init.d. However, I wanted to find some option where the command runs only at power up or shutdown, not on reboot.
Is there any kind of linux service that can reliably determine if the system is powering up or shutting down and run a command?
init-script amazon-ec2
New contributor
add a comment |Â
up vote
1
down vote
favorite
I have some EC2 instances and I wanted to run a command whenever an instance is created or terminated. Some of the solutions that AWS offers are not very simple (like using SNS topics and using lifecycle hooks), so they are not an option for me.
One my options was running a script in init.d. However, I wanted to find some option where the command runs only at power up or shutdown, not on reboot.
Is there any kind of linux service that can reliably determine if the system is powering up or shutting down and run a command?
init-script amazon-ec2
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have some EC2 instances and I wanted to run a command whenever an instance is created or terminated. Some of the solutions that AWS offers are not very simple (like using SNS topics and using lifecycle hooks), so they are not an option for me.
One my options was running a script in init.d. However, I wanted to find some option where the command runs only at power up or shutdown, not on reboot.
Is there any kind of linux service that can reliably determine if the system is powering up or shutting down and run a command?
init-script amazon-ec2
New contributor
I have some EC2 instances and I wanted to run a command whenever an instance is created or terminated. Some of the solutions that AWS offers are not very simple (like using SNS topics and using lifecycle hooks), so they are not an option for me.
One my options was running a script in init.d. However, I wanted to find some option where the command runs only at power up or shutdown, not on reboot.
Is there any kind of linux service that can reliably determine if the system is powering up or shutting down and run a command?
init-script amazon-ec2
init-script amazon-ec2
New contributor
New contributor
New contributor
asked Oct 4 at 5:07
Filipe Rodrigues
62
62
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Filipe Rodrigues is a new contributor. Be nice, and check out our Code of Conduct.
Filipe Rodrigues is a new contributor. Be nice, and check out our Code of Conduct.
Filipe Rodrigues is a new contributor. Be nice, and check out our Code of Conduct.
Filipe Rodrigues is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473140%2fhow-to-run-a-command-in-power-up-or-shutdown-not-reboot%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password