August 31, 2018 admin

chkconfig vs systemctl on Amazon T3 intances.

I was a bit surprised when installing Apache 2.4 on Amazon EC2 T3 instance that chkconfig did not work like it does on my T2 instances; instead you use systemctl.

Here is a bit of a conversion table for the two.

List processes
chkconfig:

# chkconfig –list
systemd:

# systemctl list-units
Enable a service
chkconfig:

# chkconfig <servicename> on
systemd:

# systemctl enable <servicename>.service
Disable a service
chkconfig:

# chkconfig <servicename> off
systemd:

# systemctl disable <servicename>.service
Start a service
chkconfig:

# service <servicename> start
systemd:

# systemctl start <servicename>.service
Stop a service
chkconfig:

# service <servicename> stop
systemd:

# systemctl stop <servicename>.service
Check the status of a service
chkconfig:

# service <servicename> status
systemd:

# systemctl status <servicename>.service

I believe this is because the Amazon T3 instances have updated Centos, Rhel and Fedora features.

If we take a peak at the operating system we see

[ec2-user@ip-172-30-1-174 ~]$ cat /etc/*-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Amazon Linux 2

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *