linux - User input is not promted in CentOS7 using systemctl or service command -


am trying stop system service using systemctl or service command. command follows

systemctl start service_name or service service_name start 

in stop method asking user enter password not display on console(suspecting ran in background). stop method follows

stop() { read -s -p "please provide password stop service" passwd } 

the same ran in centos 6 using service command, displayed on console , entered input. can please suggest me missed here prompt or how can prompt user input using systemctl.

finally, come know how read password user in centos 7. command.

pwd=`systemd-ask-password --no-tty "please enter admin password "` 

systemd-ask-password — query user system password


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -