Results 1 to 5 of 5

Thread: Deleted file by mistake - /etc/init.d/postgresql-8.4

  1. #1
    Just burned his ISO
    Join Date
    Apr 2011
    Posts
    15

    Default Deleted file by mistake - /etc/init.d/postgresql-8.4

    I deleted /etc/init.d/postgresql-8.4 by mistake and now I can't get it back. Tried reinstalling postgresql, but the file is still missing. So now I can't start the service
    If someone can share his with me or points me to a way to restore it I'd be more than thankful.

  2. #2
    Just burned his ISO
    Join Date
    Jul 2010
    Posts
    3

    Default Re: Deleted file by mistake - /etc/init.d/postgresql-8.4

    echo the below script into a file named postgresql-8.4 and move it into /etc/init.d/

    Once you have done this run the following commands (if running as root - you don't need the 'sudo' in either of them)
    This first command will give the ownership of the file to root
    Code:
    # sudo chown root:root /etc/init.d/postgresql-8.4
    This second command will make the file read/write/executable for the user (owner) of the file which will be root in this case.
    Code:
    # sudo chmod u+rwx /etc/init.d/postgresql-8.4


    The script you need to echo into the file /etc/init.d/postgresql-8.4:

    Code:
    #!/bin/sh -e
    
    ### BEGIN INIT INFO
    # Provides:		postgresql postgresql-8.4
    # Required-Start:	$local_fs $remote_fs $network $time
    # Required-Stop:	$local_fs $remote_fs $network $time
    # Should-Start:		$syslog
    # Should-Stop:		$syslog
    # Default-Start:	2 3 4 5
    # Default-Stop:		0 1 6
    # Short-Description:	PostgreSQL 8.4 RDBMS server
    ### END INIT INFO
    
    # Setting environment variables for the postmaster here does not work; please
    # set them in /etc/postgresql/8.4/<cluster>/environment instead.
    
    [ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
    
    . /usr/share/postgresql-common/init.d-functions
    
    VERSION=8.4
    
    case "$1" in
        start)
            start $VERSION
            ;;
        stop)
            stop "$VERSION"
            ;;
        restart)
    	restart "$VERSION"
            ;;
        force-reload | reload)
            reload $VERSION
            ;;
        status)
            status $VERSION
    	;;
        *)
            echo "Usage: $0 {start|stop|restart|reload|force-reload|status|autovac-start|autovac-stop|autovac-restart}"
            exit 1
            ;;
    esac
    
    exit 0


    You should now be able to manipulate the service via the /etc/init.d or service commands:
    Code:
    # /etc/init.d/postgresql-8.4 start
    # /etc/init.d/postgresql-8.4 start

  3. #3
    Good friend of the forums scottm99's Avatar
    Join Date
    Feb 2010
    Location
    underwater
    Posts
    371

    Default Re: Deleted file by mistake - /etc/init.d/postgresql-8.4

    Assuming it's not practical to flatten & rebuild your main BT5 box, here's what I'd do. If you have a windows box, download a free version of VM software at vmware.com. Then, download & install the VM image that's the same as your messed-up install. Finally, copy the missing file(s) off to a thumb drive & drop them onto your main install. Might take awhile, but this should get you going again.
    If I could figure out how to scuba dive & hack at the same time, there would be nothing I couldn't do...

  4. #4
    Just burned his ISO
    Join Date
    Apr 2011
    Posts
    15

    Default Re: Deleted file by mistake - /etc/init.d/postgresql-8.4

    Thanks @scottm99. I completely blocked off that opportunity. Even better I have a USB stick with BT5 somewhere around here that doesn't have persistence. Gonna use that to get the file

    Thanks a lot. Now that I think about it, it was quite a silly question with a simple solution.

    EDIT:

    At the time I wrote this post, forsberg94's post didn't exist... I guess due to the 'approval' system -_- Thanks tho, that is QUITE useful.
    Last edited by Unhumanje; 06-22-2011 at 12:55 AM.

  5. #5
    Good friend of the forums scottm99's Avatar
    Join Date
    Feb 2010
    Location
    underwater
    Posts
    371

    Default Re: Deleted file by mistake - /etc/init.d/postgresql-8.4

    No problem...and you're welcome I've had to do that very thing to get around other non-BT related issues. I think the solution by forsberg94 is more elegant than mine, though.
    If I could figure out how to scuba dive & hack at the same time, there would be nothing I couldn't do...

Similar Threads

  1. No init found. Try passing init = bootarg
    By GoldenTequila in forum Beginners Forum
    Replies: 2
    Last Post: 07-14-2010, 01:20 PM
  2. BT4 USB Modem big mistake
    By guide_shen in forum Beginners Forum
    Replies: 1
    Last Post: 02-17-2010, 09:33 AM
  3. Why was my post deleted?
    By v3rsificator in forum OLD Newbie Area
    Replies: 2
    Last Post: 11-13-2009, 08:07 PM
  4. Replies: 5
    Last Post: 05-04-2009, 10:27 PM
  5. typo Mistake in USB Edition
    By imported_rul3z in forum OLD BT3beta Bugs and Fixes
    Replies: 1
    Last Post: 02-28-2008, 09:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •