Ubuntu 14.04에 대한 시스템 프로비저닝 프로세스의 일부로 스크립트가 완료 될 때까지 사용자 로그인을 차단하고 싶습니다. 다음 내용으로 신생 작업이 있습니다.
start on (local-filesystems and net-device-up IFACE!=lo)
stop on [!12345]
script
#launch the bash script that does install
/bin/bash /path/to/provisioning-script.sh
end script
이 스크립트는 시작할 때 실행되지만 사용자가 로그인하는 것을 막지는 않습니다. start 지시문도 시도했습니다.
start on starting lightdm
그러나:
다음 코드를 사용하여 우분투 16.04 (systemd)에서 원하는 결과를 얻었습니다.
[Unit]
DefaultDependencies=no
After=network.target
Before=systemd-user-sessions.service
[Service]
Type=oneshot
ExecStart=/bin/bash /path/to/provisioning-script.sh
StandardOutput=journal+console
StandardError=journal+console
[Install]
RequiredBy=systemd-user-sessions.service
감사!
나는 질문의 첫 부분에 대답했다. started
서비스 단계 에서 스크립트를 실행하는 대신 단계에서 실행하고 싶습니다 prestart
. 이를 prestart
위해 스크립트 태그 앞에 추가해야 했습니다.
기본적으로 결과는 명령이 완료 started
될 때까지 서비스가 고려 prestart
되지 않고 내 서비스가 .NET이 될 때까지 lightdm 서비스가 시작되지 않습니다 started
.
start on starting lightdm
stop on [!12345]
prestart script
#launch the bash script that does install
/bin/bash /path/to/provisioning-script.sh
end script
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다