-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from sealink/TF-704-add-run-on-startup-script
[TF-704] Add run-on-startup script
- Loading branch information
Showing
4 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
files: | ||
"/etc/init.d/run_on_startup.sh": | ||
mode: "000755" | ||
owner: root | ||
group: root | ||
content: | | ||
#!/bin/bash | ||
### BEGIN INIT INFO | ||
# Provides: run_on_startup.sh | ||
# Required-Start: $local_fs $remote_fs | ||
# Required-Stop: | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: | ||
# Short-Description: My Custom Startup Script | ||
### END INIT INFO | ||
|
||
echo "$1" >> "/tmp/hello-$(date +"%d-%m-%Y").txt" | ||
case "$1" in | ||
start) | ||
echo "Starting run_on_startup..." | ||
/home/ec2-user/remount_sftp.sh | ||
;; | ||
stop) | ||
echo "Umount /mnt/nfs endpoint..." | ||
umount /mnt/nfs/ | ||
;; | ||
restart) | ||
$0 stop | ||
$0 start | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|restart}" | ||
exit 1 | ||
esac | ||
|
||
exit 0 | ||
|
||
commands: | ||
01_run_on_startup: | ||
command: chmod +x /etc/init.d/run_on_startup.sh | ||
02_run_on_startup: | ||
command: | | ||
chkconfig --add run_on_startup.sh | ||
chkconfig --level 2345 run_on_startup.sh on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
## Unreleased | ||
|
||
* [TF-695] Fix nfs-mount config script | ||
* [TF-704] Add run-on-startup script | ||
|
||
## 1.6.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters