checking service status in linux

C++
service --status-all
service --status-all | more
service --status-all | grep ntpd
service --status-all | less$ sudo service httpd status
httpd is stopped
$ sudo service httpd start
Starting httpd:                                            [  OK  ]

Source

Also in C++: