Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

running dispatch on every start up #51

Open
rameshjey opened this issue Jun 24, 2015 · 2 comments
Open

running dispatch on every start up #51

rameshjey opened this issue Jun 24, 2015 · 2 comments

Comments

@rameshjey
Copy link

I am nt very familiar with Node.js and i have some issues/queries on connecting my 2 network cards to 2 different ISPs using Node.js.

  1. I installed node.js, ran npm install -g dispatch-proxy and got npm installed. I was able to assign priorities for the 2 BB connections and verify it thru speed test and got the BW sharing to work with combined speeds.
  2. when i shutdown and restarted the machine,the settings are all gone. BW sharing does not happen. How do i put this in every login.
    My machine runs windows XP sp3 and I use ver node-v0.10.22-x86 (v12 doesnot work for me).
    Any suggestions
@alexkirsz
Copy link
Owner

dispatch-proxy process runs while the cmd.exe process that spawned it stays alive. The process is killed when your computer restarts, so you have to start dispatch-proxy again.

You could use forever to start and restart the dispatch-proxy process automatically when your system restarts.

On unix, you'd do a simple forever start $(which dispatch) start [...options].

On windows, run where dispatch, copy the path of the dispatch executable, then run forever start "dispatch_path" start [...options], where dispatch_path should be replaced with the result of the previous command.

@Raybo58
Copy link

Raybo58 commented Feb 21, 2017

forever doesn't work with Windows. It doesn't survive reboots. After many hours of searching and experimenting it seems that the best way to go about it is to add it as a startup task. Go to Control Panel and choose Administrative Tools, then run the Task Scheduler and follow these steps...

  1. Make sure that Task Scheduler (Local) is selected in the left pane and from the Action menu choose Create Basic Task
  2. On the first page enter a task name. I just entered Dispatch.
  3. On the next page select When I Log On. We do this instead of choosing When The Computer Starts so that we know the Nics are up and running before creating the proxy.
  4. On the next page choose Start a Program.
  5. On the next page enter Start in the Program/Script: field and then enter /b dispatch start in the Add Arguments field. By using the Windows command Start /b we are telling the task to run without opening a new command window. If you prefer to have an open window, just enter Dispatch in the Program field and start in the Options field.
  6. On the last page check the Open The Properties Dialogue box and click Finish.
  7. On the General tab of the Properties page make sure that Run only when user is logged on is selected and then in the Configure For drop down at the bottom, select whatever version of Windows you are using.
  8. Go to the Conditions tab and uncheck everything.
  9. Go to the Settings tab and uncheck everything.
  10. Click OK and you're done.

This has a few drawbacks. First, if you choose to launch the task without a command window, you won't know if Dispatch has stopped running due to errors. I spent many hours searching and still haven't been able to find a way to determine the running state of a script. Second, your Nics have to be up and running before the task is launched. The instructions I listed won't work for me because I'm using my tethered phone as the second Nic and I have to use an app after I log on to connect to the phone.

Hope this is helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants