Posts

Showing posts from March, 2017

serviced units target service socket

Service units: A unit configuration file whose name ends in . service encodes information about a process controlled and supervised by systemd . —  systemd.service(5) systemd service units are the units that actually executes and keeps track of programs and daemon, and dependencies are used to make sure that services are started in the right order. They are the most commonly used type of units. Socket units: A unit configuration file whose name ends in ".socket" encodes information about an IPC or network socket or a file system FIFO controlled and supervised by systemd , for socket - based activation . —  systemd.socket(5) socket units on the other hand don't actually start daemons on their own, instead they just sit there and listen on an ip and a port, or a UNIX domain socket, and when something connects to it the daemon that the socket is for is started and the connection is handed to it. This is useful for making sure that big daemo

lsof -i -tcp | lsof -i :7980 | lsof –u username | lsof -r 10 -c php -a -i :1521 | kill -9 `lsof -t /tmp/obscure.lock`

Show all open connections lsof -i Show LDAP  *incoming *  connections lsof -i TCP@ 192.168 . 0.1 : 636 () #java 890 root 18u IPv6 8332031 #TCP myserver.com:42936 myserver.com:ldaps (ESTABLISHED) Who uses SMTP? lsof -i : 25 #COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME #sendmail 401 root 5u IPv4 0x300023cc141 0t0 TCP *:smtp (LISTEN) #sendmail 401 root 6u IPv6 0x3000243c200 0t0 TCP *:smtp (LISTEN) -c  option allows to see what files are open by a particular command. lsof -c mysq lsof -c ruby List processes which opened a specific file You can list only the processes which opened a specific file, by providing the filename as arguments. # lsof /var/log/syslog COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME rsyslogd 488 syslog 1w REG 8,1 1151 268940 /var/log/syslog Similarly you can also use ‘-t’ in many ways. For example, to list process id of a process which opened /var/log/syslog can be done b

suse chkconfig --list show services

default deployment tools rhel satelite and ubuntu landscape

Satellite 6.2 introduces remote execution, automating workflows and enabling users to take multiple actions against groups of systems, such as rebooting a system after a patch install or conduct rolling upgrades across hundreds of systems as easily as one. Users can easily build a script library, share scripts and share repeatable workflows, enabling less experienced administrators to execute complex workflows. In addition, users can schedule tasks and use new dashboards for enhanced interaction with systems under management. Deploying a single server Just install the Landscape Quickstart package: sudo add-apt-repository ppa:landscape/16.06 sudo apt-get update sudo apt-get install landscape-server-quickstart After it finishes, access it with a browser like  https://hostname.example.com/ Where  hostname.example.com  is the output of  hostname -f  on that machine, or just  hostname  if that fails to resolve. Deploying for Scale Out If you have Juju, you can deploy Lan

repos rhel vs ubuntu yum rpm apt-get aptitude apt-cache search

[root@192 ~]# yum repolist   Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: centos2.hti.pl  * epel: ftp.colocall.net  * extras: mirror-pl.kielcetechnologypark.net  * updates: ftp.wcss.pl repo id                        repo name                                                   status !base/7/x86_64                 CentOS-7 - Base                                              9,363 !epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_64              11,369 !extras/7/x86_64               CentOS-7 - Extras                                              311 !updates/7/x86_64              CentOS-7 - Updates                                           1,109 repolist: 22,152 [root@192 ~]#  [root@192 ~]# yum search nmap Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile  * base: centos2.hti.pl  * epel: ftp.colocall.net  * extras: ftp.vectranet.pl  * updates: ftp.wcss

scheduling processes at crontab - useful for backup jobs /etc/cron.d crontab -l

at - one time running - uses atd - use at to add jobs ============= [root@svn ~]# systemctl status atd ● atd.service - Job spooling tools    Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled; vendor preset: enabled)    Active: active ( running ) since Tue 2017-07-04 21:45:50 EEST; 2h 6min ago  Main PID: 1150 (atd)    CGroup: /system.slice/atd.service            └─1150 /usr/sbin/atd -f Jul 04 21:45:50 svn.localdomain systemd[1]: Started Job spooling tools. Jul 04 21:45:50 svn.localdomain systemd[1]: Starting Job spooling tools... [root@svn ~]#  ============= [root@svn ~]# at 23:58 at> touch /tmp/f22 at> <EOT> CTRL+D job 3 at Tue Jul  4 23:58:00 2017 [root@svn ~]# ll /var/spool/at/ total 4 -rwx------. 1 root   root   2958 Jul  4 23:56 a00003017d444a drwx------. 2 daemon daemon    6 Jul  4 23:55 spool ============= [root@192 ~]# at now + 20 days ============================= crontab - uses crond service - started by default

starting processes systemctl

Image
[root@192 ~]# systemctl status rsyslog ● rsyslog.service - System Logging Service    Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)    Active: active (running) since Sun 2017-02-05 16:55:04 EST; 1 months 10 days ago  Main PID: 1154 (rsyslogd)    CGroup: /system.slice/rsyslog.service            └─1154 /usr/sbin/rsyslogd -n Feb 05 16:55:03 192.168.154.137 systemd[1]: Starting System Logging Service... Feb 05 16:55:04 192.168.154.137 systemd[1]: Started System Logging Service. aptitude [root@192 ~]# yum install vsftpd Loaded plugins: fastestmirror, langpacks Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast base                                                                      | 3.6 kB  00:00:00      epel/x86_64/metalink                                                      |  22 kB  00:00:00      epel                                                                      | 4.3 kB  00:00:00

Emptying buffers cache and swap

Emptying the buffers cache You can signal the Linux Kernel to drop various aspects of cached items by changing the numeric argument to the above command. To free pagecache: # echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: # echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes: # echo 3 > /proc/sys/vm/drop_caches Swap If you want to clear out your swap you can use the following commands. $ free total used free shared buffers cached Mem: 7987492 7298164 689328 0 30416 457936 -/+ buffers/cache: 6809812 1177680 Swap: 5963772 609452 5354320 Then use this command to disable swap: $ swapoff -a You can confirm that it's now empty: $ free total used free shared buffers cached Mem: 7987492 7777912 209580 0 39332 489864 -/+ buffers/cache: 7248716 738776 Swap: