Linux Networking

Lateraliian

Member
Oct 19, 2004
30
0
0
Just a quick question, what would be the equivalent to hostname and etc. in Linux compared to Windows. For example, I'm trying to setup smb.conf, and the default hostname is localhost.localdomain.com. In order to talk to Windows, would this be equivalent to the Computer Name (NetBIOS name) and Workgroup in Windows? I know they need to be on the same segment and use the same Netmask if on a switch or hub., just trying to figure out what field in Linux equals what in Windows.


Thanks, IL
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The default hostname should be just localhost.localdomain but I think that's only if no networking was setup or DHCP was enabled.

In smb.conf there's a 'netbios name' option you can use to set what the box appears to be called with regards to SMB. And there's a workgroup option to set the workgroup the in which the box appears.

They only have to be on the same segment if there's no naming schemes like WINS and you need them to appear in network neighborhood, going directly to the machine via \\machine name will still. And the netmask has to be the same regardless because that's what tells the OS how large the subnet is, if you have them different one machine could be using an IP that's outside of the range the other was told was valid.
 

Lateraliian

Member
Oct 19, 2004
30
0
0
Cool, guess I haven't been paying enough attention to the file. Thanks for your input. I appreciate your time. Off I go to test...

BTW, completely seperate topic, but if I want to run a program or script while X isn't running (like VMWare Tools Config), and I don't want to reboot my box, can I edit my inittab, change my runlevel to 2, then kill X by Ctrl-Alt-Bkspc? Does this get around rebooting? Sorry if these are irritating or if they've already been answered. I tried searching this forum but I came up nil. Thanks again!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You should be able to start X by just typing 'startx'. You only want to change inittab if you want X to start at bootup.
 

Lateraliian

Member
Oct 19, 2004
30
0
0
Let me rephrase, I know my run-on sentence finished a marathon. My system starts X at boot-up automatically. If I want to run something outside of X (meaning X cannot be running), how would I be able to kill X without changing inittab (setting runlevel to 2), then rebooting? If I Ctrl-Alt-Bkspc, then X just restarts and I get to a graphical login screen. Sorry for the mix-up.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You don't need to kill X, just hit ctrl+alt+F1 to get virtual console #1. Then if you want to get back to X it should be running on virtual console 7 or 8.
 

skene

Member
Oct 15, 2004
58
0
0
If you *do* want to kill X without it restarting, you'll need to kill the daemon that's restarting X. That's usualy gdm, kdm, or xdm depending on what distro you're using. If you do "ps -u root" you'll get a list of all programs running under root. You should see one fo those three a line or two above X. You can usualy stop it by "/etc/init.d/<daemon name> stop". If that doesn't work you can kill it with "killall <daemon name>" That's the ugly way to do it...roughly equivalent of force quitting in windows.

You can probably just do what Nothingman said though. You should do all the stuff I said from a virtual console anyways.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If you *do* want to kill X without it restarting, you'll need to kill the daemon that's restarting X. That's usualy gdm, kdm, or xdm depending on what distro you're using. If you do "ps -u root" you'll get a list of all programs running under root. You should see one fo those three a line or two above X. You can usualy stop it by "/etc/init.d/<daemon name> stop". If that doesn't work you can kill it with "killall <daemon name>" That's the ugly way to do it...roughly equivalent of force quitting in windows.

On most distros the display managers are started by init so you need to edit /etc/inittab to remove that entry and restart init with 'init Q'.

Debian uses 'normal' SysV style scripts so you can stop a dm by issuing '/etc/init.d/gdm stop' to stop gdm.

If that doesn't work you can kill it with "killall <daemon name>" That's the ugly way to do it...roughly equivalent of force quitting in windows.

Not really, by default kill and killall (not a good idea to use it on anything other than Linux though) send SIGQUIT by default which gives the process a chance to cleanup and exit gracefully. Using 'kill -9' or 'kill -KILL' is a forced quit.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
usually on systems that have gdm or kdm or xdm on by default if you try to kill the program then it will simply respawn itself.

On most redhat-style operating systems (mandrake/suse/redhat/fedora) they have different runlevels. If you switch to runlevel 3 it'll turn off the *dm daemon. You do that with the "telinit 3" command from a console. To turn it back on you go "telinit 5"

On debian-based OSes you would have to determine what your using (xdm or gdm or kdm) and then go "/etc/init.d/gdm stop" (assuming your using gdm) and that will stop X. "/etc/init.d/gdm start" will start it. and "/etc/init.d/gdm restart" will stop it then immediately restart it.

If you start it from a console with the startx command you simply log out and it'll shut off. If it freezes then you go ctrl-alt-backspace and it will kill it usually.