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,675 / 54 Page
    [ ● 트랜스코딩 활성화하는방법 >> ds3622xs+ dsm 7.1.1 성공 ] 댓글 3

    ●트랜스코딩 활성화하는방법 >> ds3622xs+ dsm 7.1.1 성공 https://svrforum.com/nas/91602참조 …

    [ 실패● Proxmox ( PVE)에서 xpenology redpill dsm7.0 설치 테스트 ]

    ● Proxmox PVE 에서 xpenology redpill dsm7.0 설치 테스트 기본 VM 구성 xpenology 설치하기자신만을 설정 …

    [ ● 설치된 드라브 목록 보기 )헤놀로지 RedPill tinyCore 만능부트로더 ]

    ● 설치된 드라브 목록)헤놀로지 RedPill tinyCore 만능부트로더빌드 진행후 바로 빌드된 드라이브 목록 보기 ext-manager.sh…

    [ ● ESX 및 인텔 터보 부스트 및 ESXi에서 CPU 주파수를 확인하는 방법 ]

    ●ESX 및 인텔 터보 부스트 및ESXi에서 CPU 주파수를 확인하는 방법-ESXi에서 CPU 주파수를 확인하는 방법esxcfg-info -w …

    [ 실패● 작업주의)acme.sh를 이용한 ECDSA Wildcard SSL 인증서 발급받는 방법 ] 댓글 2

    ● 작업)acme.sh를 이용한 ECDSA Wildcard SSL 인증서 발급받는 방법(실패)장비 : 시놀로지 DSM 7.1 https://a…

    [ ●메인 서버전환 성공) Xpenology boot loader ARPL로 전환 하기 ] 댓글 2

    ●메인 서버전환 성공) Xpenology boot loader ARPL로 전환 하기 ARPL BOOT LOADER 적용을 위한 준비 내용 1. …

    [ ● 시놀로지 네트워크 인터페이스 변경 속도가 높은 LAN 포트로 변경 합니다. ]

    ● 시놀로지 네트워크 인터페이스 변경속도가 높은 LAN 포트로 변경 합니다. 요즘 헤놀로지ARPL(Automated Redpill Loader)…

    [ Cut & Paste Login and password script II ]

    ◎ 네이버에서 [https://11q.kr 홈피] 검색 찾아오세요 ◎\r\nDescription: This is a variation of th…

    [ .[zenaplus] 이메일 재인증 확인 메일입니다. 메세지 에러 발생 해결 ] 댓글 6

    각 파일명에_update_mail3.php_update_mail3_0.php이렇게 사용하는데요...이 둘의 파일 내용은 같은 내용이나 발송시에 …

    [ 하이라이트 기능만 추가 ]

    \r\ngnu 4.34.02 기본스킨\r\n\r\n\r\n- view.skin.php 에 하이라이트 기능만 추가됨\r\n- 현재 SyntaxHi…

    [ 레이어 상단 무조건고정 ]

    \r\n목록 \r\n글쓰기\r\n요즘 유행이네요 레이어 상단 무조건고정 \r\n\r\n\r\nyuts \r\n작성일시 2012.05.16 11:…

    [ 배추빌더 라이트의 메뉴 구성 ] 댓글 2

    \r\n\r\n\r\n 슬프다 (58.♡.1.95) 2012-12-07 (금) 22:50 \r\n\r\n\r\n\r\n\r\n1. 상단 메뉴바와…

    [ 아이프레임 안 되는것 해제와 스트립트 안돠는것 해제 ]

    \r\n아이프레임 해제와 스트립트해제 상단에 동영상이 나오면 \r\n아이프레임이 안됩니다,\r\nq/a/lib/common.lib.php을수정하…


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-06-26 16:36:20

    오늘의 홈 현황


    • 현재 접속자♨ 821 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 2 명
    • 주간 가입자※ 8 명
    • 오늘 방문자 1,989 명
    • 어제 방문자 2,051 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,396,596 명
    • 전체 게시물※ 8,655 개
    • 전체 댓글수※ 24,772 개
    • 전체 회원수 11,068 명

    QR코드


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

    알림 0








    최신글↑