64

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?

YOung
  • 938
  • 2
  • 10
  • 14

3 Answers3

113

Type fg in your shell. This will resume your process

triggerNZ
  • 4,221
  • 3
  • 28
  • 34
68

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 &
Martin Konecny
  • 57,827
  • 19
  • 139
  • 159
3

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.

Solrac
  • 924
  • 8
  • 23