简体   繁体   中英

How to restart some progress which is stopped by “ctrl+z”?

When I am using

postgres -D /usr/local/pgsql/data 

to start the postgresql progress, I send a ctrl+z signal to stop it.
And now when I used createuser and psql , it has no response.

what can I do?

Type fg in your shell. This will resume your process

After you press ctrl+z it will pause execution of the current process and move it to the background. If you wish to start running it in the background, then type bg after pressing ctrl-z .

If you wish to have it run in the foreground (and take away your ability to enter new commands into the prompt), type fg after pressing ctrl-z

If you wish to run it in the background right from the beginning use & at the end of your command.

postgres -D /usr/local/pgsql/data &

If you send a process to background usning ctrl-z it will pause itself.

You can resume that using bg and it will stay running in background.

If this is not what you want then stop postgres and start it again, I would use service postgres start and service postgres stop .

If those ain't working try /etc/init.d/postgres stop and /etc/init.d/postgres start .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM