How to create an autostart script in Linux (Red Hat / CentOS / Fedora)

How to create an auto start script in Linux (Red Hat / CentOS / Fedora):

Option 1: Use chkconfig script to run /etc/init.d/…

  1. Create a script and place in /etc/init.d (e.g /etc/init.d/myscript). The script should have the following format:
#!/bin/bash
# chkconfig: 2345 20 80
# Source function library.
. /etc/init.d/functions
start() {
    # code to start app comes here 
    # example: daemon program_name &
}
stop() {
    # code to stop app comes here 
    # example: killproc program_name
}
case "$1" in 
    start)
       start
       ;;
    stop)
       stop
       ;;
    restart)
       stop
       start
       ;;
    status)
       # code to check status of app comes here 
       # example: status program_name
       ;;
    *)
       echo "Usage: $0 {start|stop|status|restart}"
esac
exit 0 

Enable the script

  1. $ chkconfig --add myscript 
    $ chkconfig --level 2345 myscript on 
    
  2. Check the script is indeed enabled – you should see “on” for the levels you selected.
    $ chkconfig --list | grep myscript
    

You can then use the script like so /etc/init.d/myscript start or chkconfig myscript start.

Option 2: Another Option is to use crontab job and run it at Boot time.

You need to use special string called @reboot. It will run once, at startup after reboot command.

@reboot  /path/to/job
@reboot  /path/to/shell.script
@reboot  /path/to/command

This is an easy way to give your users the ability to run a shell script or command at boot time without root access. First, run crontab command:
$ crontab -e
OR
# crontab -e -u doddi

Run a script called /home/doddi/bin/myScript.sh
@reboot /home/doddi/bin/myScript.sh 

Under RHEL / CentOS / Fedora, you need to enable crond on boot:
# chkconfig crond on
# service crond restart

If you are using modern distro with systemd, try
# systemctl enable crond.service
# systemctl restart crond.service
# systemctl status crond.service

 

Description about My VMware Home Lab in MacBook Pro

I just want to write this, as a personal note for me. Since I always forget when someone ask me this question about my Personal VMware Home Lab that I used to do some researches on-premise.

As described earlier in this post: http://bicarait.com/2015/09/12/penjelasan-mengenai-my-computer-home-lab-untuk-vmware-technology/
Currently I am adding another Home Lab for my research and demo to VMware customers.

MacBook Pro Retina 15-inch, OS X El Capitan (10.11.6), Quad Core 2.5 GHz Intel i7, 16 GB Memory, NVIDIA GeForce GT750M 2GB, 1 TB Flash Storage.

Detail Components:

  • I am using VMware Fusion Professional Version 8.1.1 to create Nested Virtualisation.
  • Control Server is using CentOS Linux 7 (control01.lab.bicarait.com)
    Function: NTP (ntpd), DNS (bind), LDAP (openldap), DHCP (dhcpd)
    IP: 172.16.159.142
    Username: root, Password: VMware1!
  • Shared Storage is using Openfiler 2.6 (storage01.lab.bicarait.com)
    Access: https://172.16.159.139:446/
    Username: openfiler, Password: password
    iSCSI: iqn.2006-01.com.openfiler:tsn.a7cd1aac2554 – “fusiondisk (/mnt/fusiondisk/)” using volume name “fusioniscsi1” size 100 GB – /dev/fusiondisk/fusioniscsi1 – iSCSI target: 172.16.159.139 port 3260 – datastore: ds_fusion_01
  • Virtualisation for Management Cluster is using ESXi 6.0 U2 (esxi01.lab.bicarait.com)
    IP: 172.16.159.141 (vmkernel management)
    Username: root, Password: VMware1!
  • Virtualisation for Payload Cluster is using ESXi 6.0 U2 (esxi02.lab.bicarait.com & esxi03.lab.bicarait.com)
    IP: 172.16.159.151 & 172.16.159.152 (vmkernel management)
    Username: root, Password: VMware1!
  • vCenter is using vCenter Appliance 6.0 U2 (vcsa01.lab.bicarait.com)
    IP: https://172.16.159.150/vsphere-client
    Username: administrator@vsphere.local, Password: VMware1!
  • Virtual Machines to Play with:
    PhotonVM01 – IP:  DHCP – Username: root, Password: VMware1!

This is the screenshot of my fusion environment:

screen-shot-2016-11-03-at-15-32-42

screen-shot-2016-11-04-at-15-11-52

 

Kind Regards,
Doddi Priyambodo

Kebutuhan Minimum dari VMware vCenter Appliance 6.x

I know that you can find this requirements in the Knowledge Based, I just want to write this again to remind me. Because I got a lot of this question from my customer.

Resource
Requirement
Disk storage on the host machine
Embedded Platform Services Controller:
  • Tiny: 120GB
  • Small: 150GB
  • Medium: 300GB
  • Large: 450GB
External Platform Services Controller:
  • Tiny: 86GB
  • Small: 108GB
  • Medium: 220GB
  • Large: 280GB
External Platform Services Controller Appliance:
  • Tiny: 30GB
  • Small: 30GB
  • Medium: 30GB
  • Large: 30GB
Memory in the vCenter Server Appliance

Platform Services Controller Only: 2GB Ram

All components on one Appliance.

  • Tiny: 8GB RAM
  • Small: 16GB RAM
  • Medium: 24GB RAM
  • Large: 32GB RAM
CPUs in the vCenter Server Appliance

Platform Services Controller Only: 2 CPUs

All components on one Appliance.

  • Tiny: 2 CPUs
  • Small: 4 CPUs
  • Medium: 8 CPUs
  • Large: 16 CPUs
Notes:
  • Tiny Environment (up to 10 Hosts, 100 Virtual Machines)
  • Small Environment (up to 100 Hosts, 1,000 Virtual Machines)
  • Medium Environment (up to 400 Hosts, 4,000 Virtual Machines)
  • Large Environment (up to 1,000 Hosts, 10,000 Virtual Machines)