How to integrate all the systemctl commands into a shell script to verify any daemon/agent service?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to integrate all the systemctl commands into a shell script to verify any daemon/agent service?
# 1  
Old 05-04-2018
How to integrate all the systemctl commands into a shell script to verify any daemon/agent service?

Hi,

Can we integrate all the systemctl command into a shell script to verify any service with all the options of systemctl if service integrate with the operating system service management tools to deliver their functionality.

Code:
sudo systemctl start <service_name>
sudo systemctl stop <service_name> 
sudo systemctl restart <service_name> 
sudo systemctl reload <service_name>
sudo systemctl status <service_name> 
sudo systemctl condrestart <service_name> 
sudo systemctl list-unit-files --type=service  <service_name> 
sudo systemctl enable <service_name> 
sudo systemctl disable <service_name> 
sudo systemctl is-enabled <service_name> 
sudo systemctl list-dependencies graphical.target <service_name>
sudo ls /etc/systemd/system/*.wants/ <service_name>
sudo systemctl daemon-reload <service_name>

I was thinking just to have a clear ordering and way they can run in sequence (Not much aware about the sequence and how we club them into the script to make it a functional verification script) just to verify the entire commands for the service. Please assist.

---------- Post updated 05-04-18 at 09:38 PM ---------- Previous update was 05-03-18 at 11:11 PM ----------

Any suggestions folks!
# 2  
Old 05-05-2018
The lack of reaction within almost 24 hours, and with 223 views of your post might indicate that something in your request is not too clear nor too logical nor too understandable nor makes sense to people.
You might want to rethink / rephrase your request.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script verify connection to Oracle if not successful

i have a script that connects to the oracle database and executes the query statements. it works fine and i would like to add some message to check if the connection to oracle is not successful. basically this is the code snippet: #!/bin/sh ... ... ... sqlplus -s username/password@dbName... (2 Replies)
Discussion started by: wtolentino
2 Replies

2. UNIX for Beginners Questions & Answers

Shell script newbie- how to generate service log from shell script

Hi, I am totally a newbie to any programming languages and I just started an entry level job in an IT company. One of my recent tasks is to create a script that is able to show the log file of linux service (i.e. ntpd service) lets say, if I run my script ./test.sh, the output should be... (3 Replies)
Discussion started by: xiaogeji
3 Replies

3. Web Development

Help to integrate Shell script with PHP

I have a shell script which takes user name and server name from the user and check the authentication type on that server like LDAP or VAS or local. It also provides various other info also such as owner of the ID and etc. I need this script to work on the browser where user can directly input... (2 Replies)
Discussion started by: Bhuwan Nazkani
2 Replies

4. AIX

Need help on patrol agent service in AIX

Hi, Anyone know what is patrol agent service in aix If know please tell me the command to check the same. (4 Replies)
Discussion started by: sumanthupar
4 Replies

5. Red Hat

Can't start NTOP service/daemon

I have installed version of ntop 4.0.3 by guide. But I can't start ntop daemon/service. I didn't find a service file for starting. During the installation there was no problem only want to RRDTool so I installed that. Now there is no necessary package required. I didn't find in /etc/init.d/... (9 Replies)
Discussion started by: getrue
9 Replies

6. Red Hat

difference between restarting a daemon and a service

Hi, Can you please clear me the difference between restarting the daemon and the service. To be more clear, /etc/init.d/mysqld restart and /etc/init.d/mysqld restart What is the difference on this both two?..... (4 Replies)
Discussion started by: gsiva
4 Replies

7. UNIX and Linux Applications

Integrate PHP + Unix commands

Hi I am using fedora 4, its only for desktop usage. its in gui mode. the system is always on and in login screen. whenever a particular user logins in, aphp page inside the system should run. The user should not be able to view the desktop. The user has the info in the php webpage to work... (1 Reply)
Discussion started by: karthikn7974
1 Replies

8. Shell Programming and Scripting

shell script as a daemon

hi, can i run a shell script as a daemon ? the shell script looks like this : can this be run as a service ?: thanks regards shann (1 Reply)
Discussion started by: massoo
1 Replies
Login or Register to Ask a Question