Manullay는 재부팅 시 모든 서비스를 실행합니다.

Manullay는 재부팅 시 모든 서비스를 실행합니다.

재부팅 시 Linux에서 서비스를 실행하고 싶습니다. 나도 할 수 있다는 걸 알아

sudo systemctl 활성화 service_name.service

재부팅 시 이 서비스를 실행하세요. 하지만 터미널을 사용할 수는 없습니다. 그렇다면 재부팅 시 터미널의 도움 없이 이 서비스를 실행할 수 있는 방법이 있습니까?

내 말은 이 명령이 모든 파일이나 위치를 일부 변경한다는 뜻입니다. 그래서 해당 위치를 변경하겠습니다. 더 궁금한 점이 있으면 저에게 물어보실 수 있지만 알려주시기 바랍니다.

답변1

실행하면 sudo systemctl enable service_name.service서비스 파일 섹션에 지정된 대상 디렉터리에 심볼릭 링크가 생성됩니다. [Install]가장 일반적인 디렉토리는 입니다 /etc/systemd/system/multi-user.target.wants/. 링크 이름은 service_name.service파일의 실제 위치를 가리킵니다 service_name.service.

즉, service_name.service찾아서 부분적 /usr/lib/systemd/system/service_name.service으로 [Install]표시되는 경우 WantedBy=multi-user.target해당 기본 명령은 다음과 같습니다.

ln -s /usr/lib/systemd/system/service_name.service /etc/systemd/system/multi-user.target.wants/service_name.service

가지고 있는 불특정 도구를 사용하여 루트와 동일한 작업을 수행할 수 있다면 실제로는 를 실행하는 것과 같습니다 systemctl enable service_name.service.

관련 정보