Under Windows 7, PostgreSQL 9.3.2, I'm trying to register as a service a second instance of PostgreSQL on the same server, using a different port number and data directory. The 2nd cluster was successfully created with the initdb command, under C:\Program Files\PostgreSQL\9.3\data2.
When I run the following pg_ctl register command from C:\Program Files\PostgreSQL\9.3\bin, I get an error message:
pg_ctl register -N postgresql9.2_2nd_cluster -U "NT AUTHORITY\NetworkService" -D "C:\Program Files\PostgreSQL\9.3\data2" -S auto -o "-p 5431"
pg_ctl: could not open service manager
I googled this, but without much success.
This error:
pg_ctl: could not open service manager
would suggest that you're probably on a UAC-enabled machine, and you're running in a non-admin console.
When you launch your console from Start->Command Prompt, right click on it and choose "Run as Administrator".
Open Command Prompt as admin
Open services (win+R -> services.msc)
If u can see PostgreSQL, then unregister it.
To Unregister the PostgreSQL,
pg-ctl unregister [-N SERVICENAME]
**%path%\PostgreSQL\12\bin\pg_ctl unregister -N "service_name"**
*service name will be displayed on services
Related
I am working on windows server and I want to start postgreSQL as service by the following command but it does not work. Could you tell me what is wrong ?
sc create postgresql binPath="C:\Program Files\PostgreSQL\13\bin\pg_ctl.exe" runservice -w -N "P4" -D "C:\Program Files\PostgreSQL\13\data" - start auto
UPDATE
I succedeed to create the service by running the command
pg_ctl.exe register -N PostgreSQL -D "%ProgramData%/db_data" –S auto
but when i tried to start it I have the following error message
The PostgreSQL service on local computer started and then stopped some services stop automatically if they are not in use by other services or programs
UPDATE2
One of my colleague resolved the issue. It was a per'ission issue. I hadn't the permission to start the service. The discussion is closed
i'm using psexec.exe from my CMD to access a remote machine.
everything worked fine for the first couple attempts,
but on the nth attempt (in my case the 5th attempt) i got the following error prompt message:
is not a valid win32 application
this is my command:
"C:\Program Files (x86)\myfolder\psexec.exe" \\MY_REMOTE_IP -u MY_USERNAME -p MY_PASSWORD cmd
could it be a problem of too many open connections?
where can i see my open connections if any?
how can i properly close a remote connection?
i reinstall PSExec.exe and it solved the problem, not sure what cause the issue but it definitely solved the problem.
This error usually means that the psexec service is down in the target machine.
In my case it was down because drive C was out of storage. After I free some space in drive C, I had to restart the machines for the service to start again (I couldn’t start the psexec service manually)
When starting from cmdline
svnserve.exe -d -r d:\svn\mytools
all working fine.
Then I had tried to set it up to run as Windows service:
#echo off
set SvnHome=C:\Program Files\TortoiseSVN
set SvnRepository=D:\Svn\mytools
sc delete SvnMyTools
sc create SvnMyTools binPath= "%SvnHome%\bin\svnserve.exe --service -r %SvnRepository%" start= delayed-auto type= share
service was installed but it is unable to start.
All the time it is reporting an error
Error 1083: The executable program that this service is configured to run in does not implement the service.
I have tried to edit service cmdline using regedit, so tried to add double quotes arround ref to exe, tried to change cmdline parameters (used -d instead of --service, used both -d and --service) and so on. Sometimes reported errors are looks a bit different but it does not work anyway. :-(
Question is - how to setup it to make it working as service on Windows 7 x64?
Is it possible at all? I mean - if that "--service" cmdline switch is able to work in svnserve?
Note: svnserve version is 1.7.9 (r1462340).
Rest of TortoiseSVN components are 1.7.12.24070.
Thanks in advance.
It took me a while to figure out that the selected answer was not final, but a supplement to the question. This is the final one line command to execute:
sc create svnserve binpath="\"C:\Program Files\TortoiseSVN\bin\svnserve.exe\" --service -r D:\Repositories" displayname="Subversion Server" depend=Tcpip start=auto
Looks fine to me. My server is installed with this binary path:
"C:\Program Files\Subversion\svnserve.exe" --service -r "D:\Repositories" --listen-port "3690"
Did you try to install it outside of a script?
I realize this is an old question, but in case you need to do this on a more current Windows OS version...
On Windows Server 2012 with CollabNet subversion Edge SVN v5.2.4, this syntax worked in an elevated cmd window (NOTE the space after the = character and where the quote " characters are located):
sc create svnserve binpath="E:\csvn\bin\svnserve.exe --service -r E:\csvn\data\repositories --listen-port 3690 --log-file E:\csvn\data\logs\svnserve.log" displayname="SVN Serve" depend= Tcpip start= auto
After creating the svnserve Windows service, to add a description :
sc description svnserve "SVN Server providing the svn:// or svn+ssh:// protocol scheme"
Screenshot of Services.msc showing the newly created svnserve service:
Reference: http://svnbook.red-bean.com/en/1.7/svn.serverconfig.svnserve.html
whenever i try command mpiexec -n 4 testmpi.exe
Unable to connect to 'RIJDZUAN-PC:8676', sock error: generic socket
failure, error stack: MPIDU_Sock_post_connect(1200): unable to connect
to RIJDZUAN-PC on port 8676, ex hausted all endpoints (errno -1)
MPIDU_Sock_post_connect(1247): unable to connect to RIJDZUAN-PC on
port 8676, No connection could be made because the target machine
actively refused it. (errno 10061)
and when i try to smpd -install or smpd -start giving me
OpenSCManager failed: Access is denied. (error 5)
i believe i'd already registering mpiexec over mpiexec -register
how to resolve this?
I got this message as well. Turns out when the installer says "successful" but smpd is not running, then the install is silently incorrect.
Copied (and slightly altered) from here
Uninstall previous version of MPICH2
Open an admin command prompt by right-clicking on the command prompt icon and selecting "run as administrator"
Run "msiexec /i mpich2-1.3.2p1-win-ia32.msi" from the admin command prompt to install MPICH2
During installation select that MPICH2 be installed for "Everyone" for all users.
Run wmpiconfig and store username/password. EDIT: Use your REAL windows login name and password.
Add "C:\Program Files\MPICH2\bin" to system Path and EDIT: no need to reboot
Check smpd using 'smpd -status'. it should return 'smpd running on $hostname$'
To test execution environment, go to the directory $MPICHROOT\examples and run cpi.exe using: 'mpiexec -n 4 cpi'
You can follow the above steps even if you are not logged in as an admin user. Just make sure to follow step 2 closely. If you see
OpenSCManager failed: Access is denied
It probably means you are not on an admin command prompt. If step 7 checks out, you should be good to go.
run CMD as an admin, and after words run the smdp -install comand.
i have installed mongodb on win32 and i am trying to run it as a service.
I have followed the instructions posted here: http://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx
but when when windows tries to 'load'/'run' the service there is a problem. I see the service under the services control banner constantly in the 'starting' state.
The result: the service is not started and windows is constantly trying to start it without success.
The instructions i have followed are:
At the command line
C:\mongodb\mongod -install
then
C:\mongodb\mongod -service
Then i modified the Win Registry Entry for the MongoDB Service by setting the ImagePath key to the value of C:\mongodb\mongodb.exe -service
Any advice? What am i doing wrong?
Just for future reference: running mongo as a windows service
Also lots of people seem to be saying: specify the whole path to the mongod.exe:
c:\mongo\mongod.exe --logpath "c:\mongo\logs\mongo.log" --logappend --dbpath "c:\mongo\data" --directoryperdb --install
Also if you're running Windows 7 don't forget to run the command window as an administrator.
I'd do it this way just cause I like to customize/organize things better:
Unzip mongo to where you want.
I like putting all the configuration in a file (my preference, since I didnt like default location of C:/data/db, and didn't like all the options as commandline params)...
Looks something like:
[C:\dev\mongodb\data\mongodb.conf]
dbpath = C:\dev\mongodb\data\db
logpath = C:\dev\mongodb\data\mongodb.log.txt
logappend = false
Then I put C:\dev\mongodb\bin in my Env Variable's PATH (so can call mongo.exe from any dir), but not needed...
Then on command line to install the Windows Service:
$ cd C:\dev\mongodb\bin
$ mongod.exe -f C:\dev\mongodb\data\mongodb.conf --install
It will create a Windows Service which if you want, can start manually via:
$ net start MongoDB
//Use qoutes if changed service name (via -serviceName to mongod --install), like: net start "Mongo DB"
Specifying several parameters at once is a good choice.
mongod
--install
to install as a service
--rest
to enable rest access to mongodb
–master
to set up mongodb instance as master.
–logpath
this is mandatory when you install mongodb as service
--dbpath
this too is mandatory for mongodb to run.
Here is a step by step guide describing the installation of MongoDB Service on Windows 7.
I have been faced similar issue. And i tried above solutions still have not get any result.
finally below code is solved my issue.
-> Command prompt open as administrator.
-> Copy and paste the below code after changing the proper bin and config path.
sc.exe create MongoDB binPath= "\"d:\MongoDB\bin\mongod.exe\" --service --config=\"d:\MongoDB\mongo.cfg\"" DisplayName= "MongoDB" start= "auto"
Happy Coding !!!!!!
Regardless of whether you're running as a service or not, you need to specify the --dbpath argument to mongod.exe.
Also, you shouldn't have to edit the registry. You can just issue the command like this:
C:\mongodb\mongod.exe --dbpath C:\data\db --install