Linux/centos2018. 12. 3. 17:13

_

2019.03.21

centos7 기준 아래 경로가 잘못되어 수정

# vi /usr/lib/systemd/system/servicename




# vi /usr/lib/systemd/service/servicename

[Unit]

Description = making network connection up

After = network.target


[Service]

ExecStart = /root/scripts/conup.sh


[Install]

WantedBy = multi-user.target


실제 서비스 등록

# chmod +x /root/scripts/conup.sh

# systemctl enable servicename  


[링크 : https://www.tecmint.com/create-new-service-units-in-systemd/]



+

node.js 경로줘서 실행하기


npm start --prefix path/to/your/app 


[링크 : https://stackoverflow.com/questions/36172442/how-to-npm-start-at-a-different-directory]


+

귀찮으니.. whereis로 찾아서

/bin/http-server 와(얘는 걍 스크립트)

/bin/node 를 만들어 주면 해결!(얘는 바이너리)

[링크 : http://leechwin.tistory.com/...usrbinenv-node-No-such-file-or-directory-에러가-발생하는-경우]



+

reload를 적용하려면 아래의 줄을 [service] 항목에 추가하면 되는 듯?

[Unit]

Description=The NGINX HTTP and reverse proxy server

After=syslog.target network.target remote-fs.target nss-lookup.target


[Service]

Type=forking

PIDFile=/run/nginx.pid

ExecStartPre=/usr/sbin/nginx -t

ExecStart=/usr/sbin/nginx

ExecReload=/bin/kill -s HUP $MAINPID

ExecStop=/bin/kill -s QUIT $MAINPID

PrivateTmp=true


[Install]

WantedBy=multi-user.target 


[링크 : https://www.shellhacks.com/systemd-service-file-example/]

Posted by 구차니
Linux/centos2018. 11. 16. 17:49

아래와 같이 하니 등록은 되는 듯?


# systemctl enable mariadb

Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.


# systemctl enable httpd

Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. 


[링크 : https://www.liquidweb.com/kb/how-to-install-mysql-mariadb-on-centos-7/]

[링크 : http://blog.andrewc.com/2016/06/autostart-apache-on-centos-7-boot/]

Posted by 구차니
Linux/centos2018. 9. 12. 12:53

mobaxterm으로 centos 새로 설치한거에  접속해서 gvim을 테스트 삼아 실행하는데 에러!

디스플레이가 없습니다 라고 배를 짼다.


yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 

[링크 : https://itekblog.com/ssh-x11-forwarding-display-using-mobaxterm/]

[링크 : https://stackoverflow.com/questions/40746146/how-does-mobaxterm-know-whether-x11-forwarding-is-working-on-remote-server]


그래서 찾아보니 /etc/ssh/sshd 설정도 문제가 아닌데 하고 갸우뚱 하면서 패키지 설치하고

mobaxterm 세션을 끊었다가 다시 시작하니 아래와 같이 나오면서 잘 된다!


     ┌────────────────────────────────────────────────────────────────────┐


     │                        • MobaXterm 10.9 •                          │


     │            (SSH client, X-server and networking tools)             │


     │                                                                    │


     │ ➤ SSH session to root@0.0.0.0                                      │


     │   • SSH compression : ✔                                            │


     │   • SSH-browser     : ✔                                            │


     │   • X11-forwarding  : ✔  (remote display is forwarded through SSH) │


     │   • DISPLAY         : ✔  (automatically set on remote server)      │


     │                                                                    │


     │ ➤ For more info, ctrl+click on help or visit our website           │


     └────────────────────────────────────────────────────────────────────┘




mobaxterm의 xorg-x11-xauth 특성 때문인가?

'Linux > centos' 카테고리의 다른 글

KVM spice 원격 접속시 No route to host  (0) 2019.01.28
yum checkupdate  (0) 2019.01.25
centos 서비스 등록하기  (0) 2018.12.03
centos 서비스 자동시작  (0) 2018.11.16
node.js centos에 설치하기  (0) 2018.09.11
Posted by 구차니
Linux/centos2018. 9. 11. 15:48

췟.. 귀찮네 -_ㅠ


curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

sudo yum -y install nodejs

yum install gcc-c++ make 

[링크 : https://nodejs.org/ko/download/package-manager/]

'Linux > centos' 카테고리의 다른 글

KVM spice 원격 접속시 No route to host  (0) 2019.01.28
yum checkupdate  (0) 2019.01.25
centos 서비스 등록하기  (0) 2018.12.03
centos 서비스 자동시작  (0) 2018.11.16
mobaxterm - centos 에서 X11 포워딩 안되는 경우 해결책  (0) 2018.09.12
Posted by 구차니