简体   繁体   中英

Start and Stop script of ubuntu 12.04

I have a script ( twoRules.sh ) which add rules to ovs plugin bridge.

The rules gets deleted when someone does service neutron-plugin-openvswitch-agent restart or reboots the system. So where should I put my scripts so that after the restart of neutron-plugin-openvswitch-agent the ( twoRules.sh ) scripts get executed successfully and rules remain added.

I tried putting it in /etc/init.d/neutron-plugin-openvswitch-agent file as other people suggested but this file is only called on /etc/init.d/neutron-plugin-openvswitch-agent restart and not on service neutron-plugin-openvswitch-agent restart.

You have to convert the script to aa SysV-style init script. There are many documents out there explaining about this.

http://www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian http://www.cyberciti.biz/tips/how-to-controlling-access-to-linux-services.html https://wiki.debian.org/Daemon

This way you can configure the script to be executed after certain services start or stop or when runlevel changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM