image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
LinkBack Thread Tools
  #1  
Old October 21st, 2009, 02:52 AM
Sunnz's Avatar
Who wants a stylus?
 
Join Date: Nov 2005
Location: Canberra, Australia
Posts: 374
Thanks: 4
Thanked 1 Time in 1 Post
Sunnz is on a distinguished road
Run certain command on boot up?

I want my system (10.6.x) to run something like `/sbin/ifconfig lo0 alias 127.0.0.2` at start up.

I notice that I can possibly put that command into /etc/rc.common, but there are not rc.local or something similar to that which can be found on an usual BSD system... and /etc/rc.common is already populated with a bunch of stuff, so I am wondering if there is a recommended way to do this?

Full story:
I am actually accessing my remote drive on a Samba server, and I like to do this over SSH since I would always leave the SSH port open and I like to use that instead of having another service and port open for Samba. So every time I want to access Samba I SSH into my remote machine, with the option `-L 127.0.0.2:4445:127.0.0.1:445`, on my Mac I just open Finder and connect to smb://127.0.0.2:4445.

I need SSH to listen on 127.0.0.2 on my Mac instead of 127.0.0.1 because Finder is actually smart enough to see and tell you that 127.0.0.1 is the local machine anyway, that it actually tell you to just to grab the file locally. Unfortunately Finder is not smart enough to realise the possibility of the traffic being tunnel through SSH to a remote server.

So listening on 127.0.0.2 (an alias on lo0) is a workaround... but if there is a better way to do this, that would be good too.

Thanks!!
__________________

Core 2 Duo 2.4Ghz, OSX 6.1

Opteron 2.6Ghz, OpenBSD 4.6

Last edited by Sunnz; October 21st, 2009 at 03:00 AM.
Reply With Quote
  #2  
Old October 21st, 2009, 10:42 AM
ElDiabloConCaca's Avatar
Registered User
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 12,678
Thanks: 7
Thanked 388 Times in 370 Posts
ElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of light
You want launchd:

http://developer.apple.com/macosx/launchd.html
__________________
Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display
MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM
iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb
http://www.jeffhoppe.com
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.