systemctl enable and start service

2018-09-10 1 min read Fedora
Most of the times when I want to enable the service, I find myself enabling it immediately or it is vice versa. So, the commands I used to use were: systemctl enable sshd.service systemctl start sshd.service But recently I learned that I do not need the 2 commands and this can be done in single command like below 1 <td> <div class="text codecolorer"> &nbsp; </div> </td> </tr> systemctl enable --now sshd. Continue reading

systemd – start service when you enable it

2017-03-13 1 min read Fedora
More often than not for any service, I end up doing : systemctl enable <service> systemctl start <service> But there is shorcut to this. In systemctl command when you enable the service, you can use “–now” to start the service as follows: systemctl enable --now <service> quite a timesaver 🙂

journalctl command to see kernel messages

2017-01-30 1 min read Fedora
Sometimes, there are just too many messages in journalctl output and it becomes a mystery game to search for the messages you are looking for. But luckily you do not need to use grep to find the right message. Here is example of what I had to do when I was looking for kernel messages. journalctl _TRANSPORT=kernel # To see all the fields, you can use the verbose mode journalctl _TRANSPORT=kernel -o verbose # And the filter on priority if needed to get the messages you need journalctl _TRANSPORT=kernel PRIORITY=4 # and follow journalctl _TRANSPORT=kernel PRIORITY=4 -f -l

PID File for squid in Fedora – 21 ( Fedora.next)

2015-03-24 1 min read Fedora Gnome
So, the other day, I wanted to have squid store its pid in the regular ‘var/run’ directory. Good simple enough – just add the following to “/etc/squid/squid.conf” : pid_filename /var/run/squid/squid.pid and create the /var/run/squid directory. Simple, hold on not so fast. Reboot and psssst.. ‘/var/run/squid’ is gone. Finally found that /var/run is handled by systemd-tmpfiles and thus you need to do this as well: cat <>/lib/tmpfiles.d/squid.conf d /run/squid 700 squid squid EOF So, basically you need to tell tmpfiles to create the squid directory as well. Continue reading

get systemd journal entries on web interface.

2013-12-12 1 min read Fedora
Just in case you need it, you can get the journalctl entries from systemd in the web page. First install : yum install systemd-journal-gateway Once you have done this you can get the journal entries with wget as well with wget http://localhost:19531/entries or if you prefer, you can browse with a browser at http://localhost:19531/. It has a nice little interface for browsing the entries, nothing too fancy but just sufficient. Continue reading

findmnt – find all the mounts and their source

2013-09-16 1 min read Linux
If you are looking for the source of a mount and the various options used in the mount, then the quickest way to get that is :: findmnt By default, with no parameters, it lists all the mounts in a tree like view and all the options used to mount the path. It also lists the source of the mount. By default again, it uses some capabilities of the terminal to show the tree which you can disable with the option “-a”. Continue reading

Find directory/file with inode number

2013-09-10 1 min read Fedora Linux
Couple of days back, I was getting the following error: Directory inode 2362521 has an unallocated block #245823. Allocate? And this continued for hours together and I was in a hurry. Did not really care about the error and all I wanted was to get rid of the error but for that I needed to get to the file/directory with inode number mentioned in the error and finally “find” command came to rescue: Continue reading
Older posts