How to restart some progress which is stopped by "ctrl+z"?
Asked Answered
H

3

80

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?

Hixson answered 28/10, 2014 at 3:15 Comment(0)
C
73

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 &
Cageling answered 28/10, 2014 at 3:27 Comment(0)
A
146

Type fg in your shell. This will resume your process

Anal answered 28/10, 2014 at 3:20 Comment(1)
or bg to resume your process on the backgroundSteeplechase
C
73

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 &
Cageling answered 28/10, 2014 at 3:27 Comment(0)
B
4

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.

Bibliogony answered 28/10, 2014 at 4:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.