Поиск по этому блогу

Показаны сообщения с ярлыком Solaris. Показать все сообщения
Показаны сообщения с ярлыком Solaris. Показать все сообщения

среда, 17 июня 2015 г.

single line bash script that kills all screen sessions

In continuation of previous post:
for n in `screen -ls | awk {'print $1'} | grep [0-9].\.. `; do screen -S $n -X quit; done

вторник, 16 июня 2015 г.

How to run command in screen tool and detach

I know that it could be googled, but I always forget this trick.

I'm going to run sleep 10 command.

It's pretty easy:
screen -dmS SCREEN_NAME
screen -S SCREEN_NAME -X stuff 'sleep 10'`echo -ne '\015'`

Note:
Of course someone could add comment that another way to run the command in screen is:
screen -dmS SCREEN_NAME "sleep 10"
I agree, but there is different behaviour: screen will be closed as soon as the command exited, that is why I have provided 2 commands, first one creates a screen, the second one runs sleep 10 command. You alway could attach to the screen and check out stdout/stderr.

среда, 3 июня 2009 г.

How To: Change IP Address in Solaris 10 without reboot

Adding or editing the IP address on a Solaris 10 server is different from the previous versions of
the OS (Solaris 9, Solaris 8 etc).

In the previous versions of the Solaris Operating System, you need to edit the /etc/hosts file
and add/edit the entry for the IP address and the hostname.

Example:

192.168.1.1 sun1


However, in Solaris 10, you should edit the /etc/hosts file (a symlink to /etc/inet/hosts file) and
the /etc/inet/ipnodes file and add an entry for IP address and hostname.

Once done, restart the Network service using

# svcadm restart network/physical

or reboot the server for the changes to take effect.

Although, the /etc/inet/ipnodes files is primarily for IPv6 only, without adding an entry
to the file, the IP address (IPv4) doesn't become active. This seems to be a known problem
but the good news is this is now fixed in the Solaris 10 U4 (08/07 build).

Also, ensure that the /etc/netmasks file with the network ID and the netmask.

Or you can change it on the fly by running this command:
#ifconfig xl0 inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255


UPDATE: It seems that Solaris 10 now checks the /etc/inet/ipnodes file first before the /etc/hosts file to set the IP. So, if the IP is currently set in /etc/inet/ipnodes, you will have to change it there as well.
IP -> /etc/hosts
Netmask -> /etc/netmasks
Gateway -> /etc/defaultrouter
IP (again) -> /etc/inet/ipnodes (This is new in Solaris 10)
DNS Servers -> /etc/resolv.conf

And that's that! You now have your IP information set.