0

It is strange the script use to work fine,but after the proxy went down for a while,it don't work all the time. But the command in script section can still do it's job,and I have no idea what's going on.

description     "Secure Gate Through"


# no start option as you might not want it to auto-start
# This might not be supported - you might need a: start on runlevel [3]
stop on runlevel [!2345]

# if you want it to automatically restart if it crashes, leave the next line in
respawn

script
        plink -v -N [email protected] -D 127.0.0.1:8580 -pw ****
end script

After start,I can see plink in ps -A,but the forwarding don't work at all.

1 Answer 1

2

Firstly, why do you not have a 'start on' condition specified? Do you really only ever want this service to be started manually?

Second, you can simplify the configuration to be just:

exec plink -v -N [email protected] -D 127.0.0.1:8580 -pw ****

In other words, you don't need 'script' as that just passes the command through the shell. Next, I'd be very wary of hard-coding a password in a job file like this (and IP addresses etc for that matter).

As to what is causing your job to behave strangely, does /var/log/upstart/plink.log give you any indication of the issue?

The Upstart Cookbook provides lots of information you might find useful including:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .