11.Nas_1


새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


데비안 10 rc.local 추가 파일 생성 실행파일 만들기

♨ 카랜더 일정 :
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    데비안 10  rc.local 추가  파일 생성 실행파일 만들기

    최신 데비안 버전에서는 /etc/rc.local 파일이 더 이상 사용되지 않지만

    여전히 의존하는 스크립트 나 응용 프로그램에 systemd를 사용하여 다시 추가 할 수 있습니다.


    이것은 올바른 방법이 아니며 스크립트 또는 응용 프로그램에 대한 서비스를 만들어야 할 수도 있지만

    아직 모든 것을 마이그레이션하는 데 시간을 보내고 싶지 않으면 rc.local을 추가하면됩니다.

    데비안 10으로 파일을 다시 보냅니다.

    먼저 서비스 파일을 만들어야합니다 :


    cat <<EOF >> /etc/systemd/system/rc-local.service

    [Unit]

    Description=/etc/rc.local

    ConditionPathExists=/etc/rc.local

     

    [Service]

    Type=forking

    ExecStart=/etc/rc.local start

    TimeoutSec=0

    StandardOutput=tty

    RemainAfterExit=yes

    SysVStartPriority=99

     

    [Install]

    WantedBy=multi-user.target

    EOF

    ------------

    파일 내용 추가

    root@localhost:~# nano /etc/systemd/system/rc-local.service

    권한 변경

    root@localhost:~# chmod a+x /etc/systemd/system/rc-local.service

    root@localhost:~# chmod 755 /etc/systemd/system/rc-local.service


    3232235521_1574862138.2664.png

    그런 다음 rc.local 파일을 다시 만듭니다.

    cat <<EOF >> /etc/rc.local

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    exit 0


    권한을 설정하십시오.

    chmod + x / etc / rc.local


    부팅 중에 서비스가 시작되도록 설정

    systemctl enable rc-local

    그리고 마지막으로 서비스를 시작하십시오

    systemctl start rc-local


    다음을

    사용하여 서비스 상태를 볼 수 있습니다. 부팅 중에 서비스가 시작되도록 설정

    systemctl status rc-local

    이제 원하는 것을 rc.local 파일에 다시 추가 할 수 있습니다.

    물론 이것은 올바른 방법이 아닙니다.

    가능한 경우 시스템에서 스크립트 / 프로그램에 대한 서비스를 추가하는 것이 가장 좋습니다.

    ==============  사례 및 적용 작업================

    <droppy 시작파일 만들기>

    1)/etc/init.d/droppy 를 생성합니다.

    root@AOL-Debi/droppy


    2) # 실행 권한 줍니다.

    root@AOL-Debian:~# chmod a+x /etc/init.d/droppy

    3) # 부팅시 자동실행 설정합니다.

    root@AOL-Debian:~# update-rc.d droppy defaults

    4) 정상적으로 작동하는지 봅니다.

    root@AOL-Debian:~# ps -ef | grep droppy

    root     14485     1  0 02:33 ?        00:00:00 /bin/bash /etc/droppy/run.sh

    root     14486 14485 37 02:33 ?        00:00:02 droppy                                                                        

    root     14529  2635  0 02:33 pts/0    00:00:00 grep droppy

    root@AOL-Debian:~#

    --------------------

    ----------------------

    cd /etc/init.d

    cd ~

    pwd

    /root

    cp tvh_start /etc/init.d

    nano /etc/init.d/tvh_start

    cd /etc/init.d

    update-rc.d tvh_start defaults

    /etc/init.d/tvh_start

    ps -ef | grep tvh_start 


    root@localhost:~# service tvheadend restart

    [....] Restarting Tvheadend: tvheadend/etc/init.d/tvheadend: 59: /etc/init.d/tvheadend: udevadm: not found

    . ok

    root@localhost:~# nano /etc/init.d/tvh_start

    root@localhost:~# ps -ef | grep tvheadend

    10075    30293     1  5 14:29 ?        00:00:01 /usr/bin/tvheadend -f -u hts -g video

    10075    30359 30192  0 14:29 pts/1    00:00:00 grep tvheadend

    root@localhost:~# ./3

    [ ok ] Stopping Tvheadend: tvheadend.

    root@localhost:~# ps -ef | grep tvheadend

    10075    30392 30192  0 14:29 pts/1    00:00:00 grep tvheadend

    root@localhost:~#



    ============================================

    systemctl enable plexdrive - 부팅 시 자동 실행되도록 설정

    systemctl disable plexdrive - 부팅 시 자동 실행 해제

    systemctl [start|restart|stop|status] plexdrive - 실행|재실행|중지|상태보기


    ===========================================

    systemd로 rc.local 서비스를 실행하는 대신 systemd로 plexdrive를 실행하는 것을 생각하지 않으시다니요!


    아래를 참조하여 경로를 적절히 수정하여 /etc/systemd/system/plexdrive.service 파일을 만듭니다.

    -----------------------

    [Unit]

    Description=Plexdrive

    AssertPathIsDirectory=/mnt/plexdrive

    After=syslog.target network.target

    PropagatesReloadTo=plexunion.service plexmediaserver.service


    [Service]

    Type=simple

    ExecStart=/usr/bin/plexdrive mount -c /root/.plexdrive \

    --fuse-options=default_permissions,allow_other \

    --uid=1000 --gid=44 --umask=0775 \

    --chunk-check-threads=4 \

    --chunk-load-ahead=2 \

    --chunk-load-threads=4 \

    --chunk-size=1M \

    --max-chunks=256 \

    --refresh-interval=10m \

    -v 0 /mnt/plexdrive

    ExecStop=/bin/fusermount -uz /mnt/plexdrive

    Restart=on-failure

    RestartSec=5

    StartLimitInterval=60s

    StartLimitBurst=3


    [Install]

    WantedBy=default.target

    ----------------

    After= 구문은 다음에 있는 서비스가 실행된 후에 이 서비스가 실행되도록 지정합니다.

    PropagatesReloadTo= 구문은 이 서비스가 다시 실행된 후에 나열된 서비스도 다시 실행되도록 지정합니다.

    ----------------

    systemctl enable plexdrive - 부팅 시 자동 실행되도록 설정

    systemctl disable plexdrive - 부팅 시 자동 실행 해제

    systemctl [start|restart|stop|status] plexdrive - 실행|재실행|중지|상태보기


    rc.local보다 구문도 간단하고 안정성도 좋습니다~


    ================

    부팅시 스크립트를 자동으로 수행하기 위해서, EC2 Launch시 UserData를 사용할 수 있다.


    리눅스 내부에서는 /etc/rc.d/rc.local/ 에 넣어주면 된다.


    root 권한으로 실행을 하려면

    su root -c “/opt/bin/myscript.sh &” 을 적어주어야 하며,


    가장 상단의 #!/bin/sh 의 경우, #!/bin/bash와 다르게

    export PATH=$PATH:/opt/bin 으로 주면 환경 변수 설정에 실패한다. 대신


    PATH=$PATH:/opt/bin

    export PATH 으로 설정해야 한다.


    주의하자. (sh 실행 권한 도 주의 필요. chmod 1 3 7 중 하나)


    ■ ▶ ☞ ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다. https://11q.kr ♠

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    profile_image

    shimss@11q.kr님의 댓글

    shimss@11q.kr 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 아이피 (192.♡.0.1) 작성일

    데비안 10 rc.local 추가 파일 생성 실행파일 만들기
    ================
    cp tvh_start /etc/init.d
    nano /etc/init.d/tvh_start
    chmod a+x /etc/init.d/tvh_start
    cd /etc/init.d
    update-rc.d tvh_start defaults
    /etc/init.d/tvh_start
    ps -ef | grep tvh_start
    ===============
    11.sh
    을  rc.local 추가

    목록

    새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사




    Total 1,684 / 42 Page
    [ 해결)배추스킨 모바일 화면 보기 넓어짐 반응형 사이즈건 설정의 인기게시물 길이45이하로 설정 ] 댓글 1

    모바일 화면 보기 넓어짐 사이즈건배추스킨>설정 >기본설정 >인기 게시물 >길이[45]글자 이하에서 모바일 반응형 게시판 폭…

    [ 스마트 에디터 툴바 아이콘 삭제하는 방법 ]

    스마트 에디터 툴바 아이콘 중에서 잘 사용하지 않는 기능들을 삭제하는 방법입니다.모바일 같은 곳에서는 가로 사이즈가 좁기 때문에 일부 아이콘만 …

    [ How To Get The Full Google Play Store on the Shield TV(u5pvr… ] 댓글 1

    How To Get The Full Google Play Store on the Shield TV(u5pvr) 구글 앱 업데이트참고적으로 sdc…

    [ smb연결) 시놀로지 네트워크 드라이브 totalcmd로 삼바 연결하기 ]

    1) 제어판 smb 서비스 활성화2) 사용자 권한 설정 >> 해당 아이디의 모든...모두 check 합니다.아래의 설정 진행 시 접속…

    [ u5pvr) U5 Air Remote 실행 OTA이후 BT 페어링모드 톱니바퀴 누룸 동작 안되어 페어링 … ] 댓글 8

    u5pvr) U5 Air Remote 실행 OTA이후 BT 페어링모드 톱니바퀴 누룸 동작 안되어 페어링 않됨을 조치를 공유 드립니다파일 이전 자…

    [ vmware iso 파일 booting이 되지 않네요 해결 방법 ]

    vmware REMIXOS... iso 파일 booting이 되지 않네요 아래와같이 부팅 되지 않습니다> UTRAIOS를 설치하여 부팅되는…

    [ 윈도우 최신버전에서 우툰을 설치 할수 있는 정보 및 xpenology DSM 6.1을 Windows… ]

    xpenology Windows 10이 설치된 DSM 6.1 및 bash로 빌드윈도우 최신버전에서 우툰을 설치 할수 있는 정보 입니다그리고 아래…

    [ 펌)도커]Synology NAS Docker 우분투 컨테이너 생성 ]

    도커]Synology NAS Docker 우분투 컨테이너 생성출처:http://naltaengi.tistory.com/41[날탱이가 되고픈 개발…

    [ Tvheadend 전자프로그램가이드 epg그래버모듈 web 구동 wget 다운로드하여 cat으로 불러오… ]

    Tvheadend 전자프로그램가이드 epg그래버모듈 web 구동 wget 다운로드하여 cat으로 불러오기왜) xmltv 만드는동안 안정되게 단계…

    [ 서버에 아파치 설치 후 php소스가 그대로 보일때.. ]

    서버에 아파치 설치 후 php소스가 그대로 보일때..최고관리자 서버 07,3712012.02.23 21:38먼저 확인해볼 사항들이 있다.*확장자…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-07-04 01:52:57

    오늘의 홈 현황


    • 현재 접속자♨ 657 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 7 명
    • 주간 가입자※ 16 명
    • 오늘 방문자 810 명
    • 어제 방문자 1,946 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,412,108 명
    • 전체 게시물※ 8,674 개
    • 전체 댓글수※ 24,821 개
    • 전체 회원수 11,086 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑