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,685 / 18 Page
    [ ● 추천)Piwigo 11.5.0 버전 시놀로지서버에 Photo 사진관리 sw 설치 작업 ] 댓글 2

    ●Piwigo 11.5.0 버전 시놀로지서버에 Photo 사진관리 sw 설치 작업 1> 썸네일 작업이 필요 없다2> 파일 업로드 간편…

    [ ● 정보) esxi에 vib파일로 된 드라이버 설치방법. ]

    ●esxi에 vib파일로 된 드라이버 설치방법.파일이름이 driver.vib 라고 할 경우..1. web에서ESXi 접속2. 유지보수 모드로 변…

    [ ● img vmdk 마운트 수정하기 )헤놀로지 RedPill tinyCore 만능부트로더 for Native… ] 댓글 1

    ● img vmdk 마운트 수정하기 )헤놀로지 RedPill tinyCore 만능부트로더 for Native img 적용파일 수정하기헤놀로지 R…

    [ ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 지메일/카카오메일 설정하기 ]

    ● 시놀로지 알림 설정으로 이밴트 카톡으로 받기 (1) 이밴트에 지메일 설정 > 이메일 수신 테스트 설정입니다(2) 구글 이메일 2단계 인…

    [ ●●● dsm 7.1빌드작업 esxi 서버의 tinycore 에 myv.sh 적용하여 랜인식을 위한 수… ] 댓글 20

    ● dsm 7.1빌드작업 esxi 서버의 tinycore 에 myv.sh 적용하여 랜인식을 위한 수정작업 boot loader updated:\…

    [ ● android-studio-2021.2.1.14-windows.exe 설치작업 ]

    ●android-studio-2021.2.1.14-windows.exe 설치작업android-studio 검색 다운로드 exe 파일 다운로드 합…

    [ ● Amcrest 카메라를 시놀로지 NAS에 설정하는 방법 ]

    ●Amcrest카메라를시놀로지NAS에 설정하는 방법 정보출처:https://support.amcrest.com/hc/en-us/articles/…

    [ ● ubuntu 설치된 패키지 apt-clone 저장 백업 복원하기 ]

    ● ubuntu 설치된 패키지apt-clone 저장 백업 복원하기Apt-clone, Ubuntu에 설치된 패키지 복제https://github.…

    [ ● [가비아 매뉴얼] DNS 레코드 설정하기 SSL인증서 cafe24 사용기 및 주의요함 ]

    ●[가비아 매뉴얼] DNS 레코드 설정하기 SSL인증서 cafe24 사용기 어려운 DNS 인지 무료인증서 사용하다 주당 5회 인증서 생성하니 문…

    [ ★★ DSM 7.2.1 UP) 새로운 레드필 로더 ARPL(Automated Redpill Loader)로… ] 댓글 17

    ★★ DSM 7.2.1 UP) 새로운 레드필 로더 ARPL(Automated Redpill Loader)로 빌드하기 강력 추천 dsm 7.2.1…

    [ 시계_html clock ] 댓글 2

    \r\n\r\nfunction tick() {\r\n var hours, minutes, seconds, ap;\r\n var intHours,…

    [ web file browser 설치방법 및 유저 로긴 문의 ] 댓글 4

    web file browser 간단 설치 유저 로그인 방법 문의\r\n\r\n안녕하세요\r\nhttps://11q.kr/webfilebrowse…

    [ 배추빌더 --> 후딱빌더 이전 하지말것 ] 댓글 1

    자유게시판후딱빌더 호환성글쓴이일임날짜2012.02.27 16:31조회439배추빌더 --> 후딱빌더 이전 할 때 대부분은 성공했는데, 글쓰는…

    [ IE6에서 레이어 고정시키기 핵. Fixed Layer Hack for IE6 ... ]

    . \r\n\r\nIE6에서 레이어 고정시키기 핵. Fixed Layer Hack for IE6 ...‎ - 2007년 9월 7일 \r\n\r\…

    [ 이미지 방지 에러 사레 ]

    . http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=220758&sca=&sfl=wr_subject…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-09-28 05:02:00

    오늘의 홈 현황


    • 현재 접속자♨ 781 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 4 명
    • 주간 가입자※ 11 명
    • 오늘 방문자 1,933 명
    • 어제 방문자 3,232 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,594,524 명
    • 전체 게시물※ 8,810 개
    • 전체 댓글수※ 25,115 개
    • 전체 회원수 11,256 명

    QR코드


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

    알림 0








    최신글↑