Three Different Ways to Reboot a Linux System

How do I reboot my Linux system? When you are a new to the Linux operating system sometimes what should be painfully obvious is not so apparent. Luckily there is more than one way to reboot your Linux box. We will go over the init, reboot and shutdown commands. All methods vary greatly in syntax so once one seems memorable, it is probably better to stick to that one. I have been using Linux a very long time so we will start off with the one I learned first.

Init 6

This method is actually probably the least used but also the safest. When you change the init level to 6, there is a clean up process that is done. This differs from a reboot command which is more like hitting the reset button. Either use sudo or log in as root.



There is a bit of controversy on the reboot command and it if actually shuts down processes in a graceful manner. It does seem to at least cleanly dismount the file system. What reboot does have going for it though, at least it is easy to remember though, because what you want to do is reboot right? So there is that. If you are clear across the globe and remoted it maybe reboot is the command for you. If a program hangs we may get stuck if you do not have a technology like PDU or iDrac available.



If you are running a multi user system then you may need to warn your users. With the shutdown command you can send a notice and delay the restart to a time you designate.


The last value is in minutes, you can actually use the word now which is an immediate reboot. You can also use a format and do a predesignated time like this. This would reboot at 11pm.

Continue Reading

Installing Postfix on Debian 9 (Stretch)

Today we will install Postfix on Debian Stretch so we can send and receive mail to a relay server. Postfix is an open-source mail transfer agent (MTA) that routes and delivers email messages. Postfix is more commonly used these days so that has been my preferred one lately.

So why should you install a mail server? I get asked this question a lot and my answer is always the same, why not? Learning how a mail server works and the intricacies of the individual systems is a huge learning curve and a very marketable skill. Even just 10 years ago running a mail server was way more trivial than it is now. Anti spam technologies may had existed then but they were not nearly as widely used. Knowing how to setup and maintain a mail server will teach you many different skills because of the hurdles you have to overcome to get one running properly. Just having your mail go to a Gmail inbox without being flagged as spawn in itself is a feat.

Always my first step is to update apt.


Now we install Postfix and also mailutils.


Configuring Postfix

After postfix is installed you will run through a configuration with a few options. This first screen is basically wanting what type of site we are setting up, for this purpose we are setting up a relay server which is a smarthost.

Postfix Configuration Screen
Postfix Configuration Screen

The next screen will ask for your mail site name, ours is

Postfix Configuration Screen - Mail Name
Postfix Configuration Screen – Mail Name

The last screen will want our relay server (smarthost), which for demonstration purposes is going to be

Postfix Relay Host
Postfix Relay Host

This is our basic default we will go through.

# See /usr/share/postfix/ for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mob01
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, mob01, localhost, localhost.localdomain, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

myhostname: The myorigin parameter specifies the domain that appears in mail that is posted on this machine.

mydestination: The mydestination parameter specifies what domains this machine will deliver locally, instead of forwarding to another machine.

inet_interfaces: Enable IPv4, and IPv6 if supported

relay_domains: By default, Postfix will forward mail from strangers. It is very important to get this setting right. In our case it is actually missing.

Continue Reading