(1) 설정
* 처음에는
해당 위치에 해당 파일이 없는 경우가 일반적이다.
또한
해당 파일이 /etc/rc.local 위치에 있어야 그 부분을 통과한다.
1.
$sudo vim /etc/rc.local
#!/bin/bash sudo -H -u yujin /opt/sword/bin/server/http_server
start & |
●
-H sets the
HOME environment variable to that of the user.
● -u specifies the username to run as.
●
& : run
this program as background.
2. $sudo chmod[1] +x /etc/rc.local
(2)
Background로 돌아가고 있는 프로그램 확인할 수 있는방법
$ ps -eo uid,pid,ppid,stat,comm | grep ${program_name}
(3) (예외) 로그인 후 프로그램이 동작하길 원함
1.
로그인 후 실행될 파일 만들기
$sudo vim /etc/profile.d/xxx.sh
#!/bin/bash /opt/sword/scripts/run_script/launcher.sh
& |
2.
Port확인 ( rest / websocket의
경우 뚫려있는지 확인필요)
$ netstat -nap |
grep 8080