Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: HowTo: Autostart Hamachi at Boot

  1. #1
    Join Date
    Jan 2005
    Location
    Charlottesville, VA
    Beans
    524
    Distro
    Ubuntu

    HowTo: Autostart Hamachi at Boot

    I've seen a few requests for this info, and I've looked for it myself. Many people use the hamachi vpn client. In windows, you can set it to start on boot. That was once a little trickier in linux, but no longer. This page at the NeoHide site worked for me on Feisty Fawn (and I posted about it on a thread here). I'm not sure if the directions originated at NeoHide or someplace else, because I've found them in a few place.

    But anyway, here are the directions:
    1. Create the start-up script for hamachi, as shown below. Remember to change the user name "your name" (line 5) to your system user name in Ubuntu (or your linux distribution). Call the script "hamachi."
      #!/bin/bash
      ###################################
      ### Start-up script for Hamachi ###
      ###################################
      USER=your name
      case "$1" in
      start)
      /sbin/tuncfg
      /bin/su - $USER -c "hamachi start"
      ;;
      stop)
      /bin/su - $USER -c "hamachi stop"
      ;;
      restart|force-reload)
      /bin/su - $USER -c "hamachi start"
      /bin/su - $USER -c "hamachi stop"
      ;;
      *)
      exit 1
      ;;
      esac
      exit 0
    2. Make the script executable:
      chmod +x hamachi
    3. Move the script to /etc/init.d/ directory:
      sudo mv hamachi /etc/init.d
    4. Finally, link the script to the appropriate run-level for booting up the system:
      sudo ln -s /etc/init.d/hamachi /etc/rc2.d/S99hamachi
      sudo ln -s /etc/init.d/hamachi /etc/rc2.d/K99hamachi
      It seems 2 is the default level for Debian and Ubuntu. In most other distribution, it is 5.
    5. Finally, reboot your system and Hamachi will be automatically loaded and connected to the server.
    Last edited by wyth; September 14th, 2007 at 06:59 PM.
    Lenovo Y510 | Ubuntu 14.04 | 1.6 GHz Pentium Dual T2330 | 4 gig RAM | Intel X3100 gfx | 250GB 5400 RPM hard drive.

    Gunga galunga...gunga- gunga lagunga.

  2. #2
    Join Date
    Feb 2007
    Beans
    264
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HowTo: Autostart Hamachi at Boot

    Step 5 says "reboot your system". I'm sure that works, what maybe this is more elegant:


    Code:
    sudo /etc/init.d/hamachi start
    HTH

  3. #3
    Join Date
    Jan 2005
    Location
    Charlottesville, VA
    Beans
    524
    Distro
    Ubuntu

    Smile Re: HowTo: Autostart Hamachi at Boot

    That is more elegant.
    Lenovo Y510 | Ubuntu 14.04 | 1.6 GHz Pentium Dual T2330 | 4 gig RAM | Intel X3100 gfx | 250GB 5400 RPM hard drive.

    Gunga galunga...gunga- gunga lagunga.

  4. #4
    Join Date
    Mar 2007
    Location
    Finland
    Beans
    22
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HowTo: Autostart Hamachi at Boot

    Nice tut', but does it work for all defaultly ? If not, please find a way to make it so.

  5. #5
    Join Date
    Jan 2005
    Location
    Charlottesville, VA
    Beans
    524
    Distro
    Ubuntu

    Re: HowTo: Autostart Hamachi at Boot

    Quote Originally Posted by rautamiekka View Post
    Nice tut', but does it work for all defaultly ? If not, please find a way to make it so.
    Yeah, we'll get right on that boss. By the way, can I have next Thursday off?
    Lenovo Y510 | Ubuntu 14.04 | 1.6 GHz Pentium Dual T2330 | 4 gig RAM | Intel X3100 gfx | 250GB 5400 RPM hard drive.

    Gunga galunga...gunga- gunga lagunga.

  6. #6
    Join Date
    Mar 2007
    Location
    Finland
    Beans
    22
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HowTo: Autostart Hamachi at Boot

    Quote Originally Posted by wyth View Post
    Yeah, we'll get right on that boss. By the way, can I have next Thursday off?
    Thanks for the respect, but you still ask wrong person

  7. #7
    Join Date
    May 2008
    Beans
    4

    Re: HowTo: Autostart Hamachi at Boot

    Ok, I don't know if it should be here... However if you want to do this in centos 5 you can use rc3.d runlevel folder.

    It worked for me.

    Bye

  8. #8
    Join Date
    Sep 2006
    Beans
    3,165
    Distro
    Ubuntu Karmic Koala (testing)

    Re: HowTo: Autostart Hamachi at Boot

    Works like a charm, thanks

  9. #9
    Join Date
    Sep 2008
    Beans
    17

    Re: HowTo: Autostart Hamachi at Boot

    Hi,
    Linux newbie alert

    I have Hamachi installed on Mythbuntu 8.10 Intrepid and its working fine but I cannot get it to start with the script it will only start with

    Code:
    sudo hamachi -c /etc/hamachi start
    When I try to run the script

    Code:
    sudo /etc/init.d/hamachi start
    I get the following error

    Code:
    /etc/init.d/hamachi: 1: !/bin/bash: not found
    tuncfg: already running
    Cannot find configuration directory /home/jase/.hamachi. Have you run 'hamachi-init' ?
    Any help would be greatly appreciated as I am so close to getting this working.

    Cheers Quazza

  10. #10
    Join Date
    Mar 2007
    Location
    Finland
    Beans
    22
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HowTo: Autostart Hamachi at Boot

    Welcome newcomer

    Please copypaste the contents of /etc/init.d/hamachi. That error sounds really fishy.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •