Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RISOLTO] Realizzazione di uno script in /etc/init.d/
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
nearthesoul
n00b
n00b


Joined: 21 Mar 2009
Posts: 53

PostPosted: Mon Jun 21, 2010 5:34 pm    Post subject: [RISOLTO] Realizzazione di uno script in /etc/init.d/ Reply with quote

Il seguente costituisce uno script che ho inserito in /etc/init.d/dropbox (dopo aver opportunamente sostituito le variabili user1 e user2 con quelli reali)

Code:

# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DROPBOX_USERS="user1 user2"
NICENESS=5

opts="${opts} status"

depend() {
    need net
}

start() {
    ebegin "Starting dropbox..."
    for dbuser in $DROPBOX_USERS; do
        start-stop-daemon -b -o -N $NICENESS -c $dbuser -S -v -e HOME="/home/$dbuser" -x /home/$dbuser/.dropbox-dist/dropboxd
    done
    eend $?
}

stop() {
    ebegin "Stopping dropbox..."
    for dbuser in $DROPBOX_USERS; do
        start-stop-daemon -o -c $dbuser -K -x /home/$dbuser/.dropbox-dist/dropbox
    done
    eend $?
}

status() {
    for dbuser in $DROPBOX_USERS; do
        dbpid=`pgrep -u $dbuser dropbox`
        if [ -z $dbpid ] ; then
            echo "dropbox for USER $dbuser: not running."
        else
            echo "dropbox for USER $dbuser: running."
        fi
    done
}


Nonostante tutti i percorsi siano corretti (compreso /home/$dbuser/.dropbox-dist/dropboxd) quando eseguo
Code:
/etc/init.d/dropbox start

non accade assolutamente nulla (non ottengo neanche un output).

Ringrazio anticipatamente chiunque vorrà aiutarmi.


Last edited by nearthesoul on Mon Jun 21, 2010 8:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
lucapost
Veteran
Veteran


Joined: 24 Nov 2005
Posts: 1415
Location: <ud|me|ts> - Italy

PostPosted: Mon Jun 21, 2010 6:52 pm    Post subject: Reply with quote

hai verificato che lo script è eseguibile? altrimenti prova con
Code:
chmod +x nome_script

_________________
LP
Back to top
View user's profile Send private message
nearthesoul
n00b
n00b


Joined: 21 Mar 2009
Posts: 53

PostPosted: Mon Jun 21, 2010 7:05 pm    Post subject: Reply with quote

Si. Avevo già lanciato i comandi

Quote:

cd /etc/init.d/
chmod +x dropbox


ma non funziona lo stesso.
Back to top
View user's profile Send private message
lucapost
Veteran
Veteran


Joined: 24 Nov 2005
Posts: 1415
Location: <ud|me|ts> - Italy

PostPosted: Mon Jun 21, 2010 7:57 pm    Post subject: Reply with quote

forse nella prima riga del file che hai postato manca:
Code:
#!/sbin/runscript

_________________
LP
Back to top
View user's profile Send private message
nearthesoul
n00b
n00b


Joined: 21 Mar 2009
Posts: 53

PostPosted: Mon Jun 21, 2010 8:57 pm    Post subject: Reply with quote

Era proprio quello il problema!!! Ora ho risolto. Grazie.

lucapost wrote:
forse nella prima riga del file che hai postato manca:
Code:
#!/sbin/runscript
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum