시작 스크립트가 시작할때는 동작하지 않습니다.

natas999의 이미지

gentoo 유저입니다.
vnc를 시스템 서비스로 사용하기 위해서 다음과 같은 시작 스크립트를 작성했습니다.

터미널에서

# /etc/init.d/vnc.natas999 start

와 같이 실행시키면 잘 작동합니다.

문제는

# rc-update add vnc.natas999 default

로 등록시킨뒤에 재부팅하면 안된다는겁니다.
rc-status로 확인해보면 OK로 나오지만 정작 ps 해보면 Xvnc는 보이지 않습니다. 게다가 열받는건
# /etc/init.d/vnc.natas999 restart

를 하면 제대로 돌아간다는겁니다.

#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        need net edonkey
}

start() {
        local user=${myservice##*.}
        ebegin "Starting vncserver for ${user}"
#       env HOME=/home/${user} start-stop-daemon --quiet --start \
#               -c ${user}  \
#               -x /usr/bin/vncserver -- -geometry ${GEOMETRY} :${DISPLAY}  \
#               &>/dev/null
        su - ${user} -c  \
                "cd ~${user} && vncserver -geometry ${GEOMETRY} :${DISPLAY}"  \
                &>/dev/null
        sleep 5
        if ! pgrep -u ${user} Xvnc >/dev/null
        then
                eerror "vncserver for ${user} failed!"
        fi
        eend $?
}

stop() {
        local user=${myservice##*.}
        ebegin "Stopping vncserver for ${user}"
        env HOME=/home/${user} /usr/bin/vncserver -kill :${DISPLAY}  \
                &>/dev/null
        local timeout=10
        while [ $timeout -gt 0 ] && pgrep -u ${user} vncserver &>/dev/null
        do
                sleep 1
                let 'timeout--'
        done
        start-stop-daemon --oknodo --stop -x /usr/bin/vncserver &>/dev/null
        eend $?
}

restart() {
        svc_stop
        sleep 5
        svc_start
}

주석처리된 start-stop-daemon을 사용하나 su -c를 사용하나 현상은 동일합니다.

natas999의 이미지

왜 진작에 로그부터 살펴볼 생각을 못했을까요. :oops:
로그파일이 말하길 xfs를 먼저 실행하고 vnc를 실행시켜야한다는군요.

# emerge girl-friend
Calculating dependencies
!!! All wemen who could satisfy "girl-friend" have been masked.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.