Create memcached service in windows failed

有些话、适合烂在心里 提交于 2019-12-02 05:26:26

问题


I'm using Memcached-for-Windows, see:

http://blog.elijaa.org/index.php?post/2010/08/25/Memcached-1.4.5-for-Windows&similar

I've tried to use:

sc create "memcached" binPath="C:/memcached/mem
cached.exe" start=auto

but I can't create the Windows service, and no warning or error, just:

Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
   (default = own)
 start= <boot|system|auto|demand|disabled>
   (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

回答1:


memcached isn't a native Windows Service so you must use a "service wrapper" program to add the missing functionality. Microsoft's free Srvany utility should do the trick but several commercial alternatives are also available.

(Note that some Windows ports of memcached support the "-d" flag to automatically install and manipulate memcached as a native Windows Service but that doesn't seem to be available in NorthScale's version...)




回答2:


To implement this, you can even execute a command line, which inturn creates a service. First go to the path where the .exe file exists through command line.

C:\Users\sireesh.yarlagadda>memcached.exe -d install

After executing this line, you will be seeing a new service created for memcached




回答3:


The reason you're getting an error is that there must be a space after the binPath= . This is a very annoying 'feature' of sc. Also you'd need a space after the start=.

sc create "memcached" binPath= "C:/memcached/memcached.exe" start= auto

The above command wouldn't give you the syntax error. However, I suspect memcached still won't run successfully as a service.




回答4:


You can build Memcached on Windows.

http://vasil9v.tumblr.com/post/31921755331/compiling-memcached-on-cygwin-windows




回答5:


According to the information on this page:

Installing Memcached on Windows

version 1.4.5 or later can not be installed as a service. It must be installed as a Windows task. Instructions to do that (for all users), considering two instances of the application:

CREATE MEMCACHED TASKS

SCHTASKS /create /sc onstart /ru system /tn memcached1 /tr "C:\Xampp\memcached\memcached.exe -m80 -p11211"
SCHTASKS /create /sc onstart /ru system /tn memcached2 /tr "C:\Xampp\memcached\memcached.exe -m80 -p11212"

The tasks above will run on restart but, if you want to run the them immediately after their creation, you can execute the commands below:

RUN MEMCACHED TASKS

SCHTASKS /run /tn memcached1
SCHTASKS /run /tn memcached2

STOP MEMCACHED TASKS

SCHTASKS /end /tn memcached1
SCHTASKS /end /tn memcached2

To delete the tasks created, do as follows:

DELETE MEMCACHED TASKS

SCHTASKS /delete /tn memcached1 /f
SCHTASKS /delete /tn memcached2 /f


来源:https://stackoverflow.com/questions/13358116/create-memcached-service-in-windows-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!