Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 proxy@12.34.96.48 -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.

share|improve this question

1 Answer 1

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 proxy@12.34.96.48 -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:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.