Can't install memcached 1.4.5 as a service on Windows - windows

Last night someone told me about memcached. It seems something I can really use to reduce loading times. So today I wanted to download the latest version 1.4.5 for Windows. I found a precompiled version and wanted to use that. However as of version 1.4.5 the -d parameter for Windows has been dropped? And I can't install it as a service.
I tried to install it via SC, and that worked, but then when i tried to start it there came an error message that:
The service is not responding to the control function.
I don't really know what to do now. Can I still use this on Windows as a non-service, or should I get the much older version 1.2.6?

Found this thread for you, it may help:
http://social.msdn.microsoft.com/Forums/eu/windowsazuredevelopment/thread/a185e766-41f5-402c-8519-48242d478d00

I have used ServiceEx to install as a service.
http://serviceex.com/
Here is what I did:
Copied ServiceEx.exe to the Memcached directory
Created Memcached.ini and configured it (http://serviceex.com/files/ServiceEx.ini.sample)
Run command Line
ServiceEx install Memcached

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 automatically on restart. However, if you want to run them immediately after their creation, do as follows:
SCHTASKS /run /tn memcached1
SCHTASKS /run /tn memcached2
To stop the tasks:
SCHTASKS /end /tn memcached1
SCHTASKS /end /tn memcached2
To delete the tasks created, execute the commands below:
DELETE MEMCACHED TASKS
SCHTASKS /delete /tn memcached1 /f
SCHTASKS /delete /tn memcached2 /f

Related

Schedule background app

So I have my application deployed to my Raspberry Pi 3 that is running win10 IoT, and I want to use schtasks to run it at certain times. Where is my application "deployed" to on the device so I can add it to a scheduled task?
Edit:
Found the app, but I can't seem to create a scheduled task to run the .winmd file.
This is what I tried:
schtasks /create /tn feedertest /sc minute /ru administrator /rp notrealpwd /mo 5 /tr "c:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\CatFeeders-uwpVS.Debug_ARM.greg\catfeeders.winmd"
WINMD file is not an executable file for running the UWP application, it is a binary file of Windows Runtime Metadata.
You need to use IotStartup command to run the UWP application on Windows IoT Core. Please refer to following command:
Update:
#create the task
schtasks /create /tn feedertest /sc minute /ru administrator /rp notrealpwd /mo 1 /tr "IotStartup add headed <your app package family name>"
#run the task
schtasks /Run /TN feedertest
BTW, you can get how to get app package family name from here.
Thank you for the help, but it looks like Windows IoT isn't the right platform for what I'm trying to do. :(
I switched Raspbian, wrote about 20 lines of python, and added it to the crontab.

Could not access schtasks(Task Scheduler) when the service is running as local system account

I read that Local system Account has maximum privileges to access all the local resources.
But still I could not create a scheduler task while running my application as a service.
When I run my application as administrator(cmd),I was able to create a scheduler task
schtasks /create /sc minute /mo 20 /tn "Tesk Check" /tr "C:\run.bat"
When I run this command as a service,I got this error
No mapping between account names and security IDs was done
Did I miss anything?

Is there a ruby gem to start/stop Windows Scheduled Tasks?

I'm looking for a ruby gem that can start/stop an already running windows scheduled tasks. Or if a gem does not exist, another work around for doing such a thing.
I believe I found the best answer, but someone else can please correct me if I'm wrong. I think my best option is to just send a command using the Windows CLI.
Looking at the windows the windows documentation it appears the command to stop a task in Windows CLI is schtasks /End [/S <system> [/U <username> [/P [<password>]]]] /TN taskname.
The command to start a task is schtasks /Run [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>.
So, with those two things in mind, in the ruby script I can use %x(windows cli command), system 'windows cli command', with varying levels of returned data. I believe there's some more from what I was reading, but I think that will work. Again, if anyone has comments or a better plan on action for what I'm trying to do, definitely all ears.

Memcached on Windows Failed to ignore SIGHUP: No error failed to daemon() in order to daemonize

I'm trying to install memcached from: http://blog.elijaa.org/index.php?post/2010/10/15/Memcached-for-Windows&similar
When I try to run it with the -d command line option I get the following error:
Failed to ignore SIGHUP: No error
failed to daemon() in order to daemonize
When I run it without -d it appears to run normally, but I need -d to install it as a service...
I've tried the following tutorials but they don't explain how to solve this.
http://shiki.me/blog/installing-memcached-for-php-5-3-on-windows-7/
http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
http://zurmo.org/wiki/installing-memcache-on-windows
How to install and use memcached in Windows for PHP?
I've tried both the 32 and 64 bit versions but it didn't make a difference.
I also tried the version from: http://code.jellycan.com/files/memcached-1.2.6-win32-bin.zip
Which does not give this error but still doesn't create the service.
Anyone know how to get this working?
Petesh's answer from the below helped me.
sc create "Memcached11211" binPath= "C:\memcached\memcached.exe -d
runservice -p 11211" DisplayName= "Memcached11211" start= auto
https://stackoverflow.com/a/18228391/3998308
I usually run this:
c:\memcached\memcached.exe -vv start
to have it as verbose as possible.
You could try:
schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"
as it says here.

Error on remote task run with "schtasks /run /s"

I want to run a task remotely. Therefore I created a .bat with
schtasks /run /s 111.20.123.160 /u Administrator /p password /tn "Task"
I just get an error: "FEHLER: Die Anforderung wird nicht unterstützt."
I also tried different users (normal and admin) and computername or IP.
My system: Win7, remote system: WinXP ... are there known issues?
Of course. schtasks controls the new task scheduler introduced with Windows Vista. XP still uses the ancient one that dates back to Windows 2000. The respective capabilities are vastly different for one and the interface as well. So while both at and schtasks work on a current system (because the old interface is mapped onto the new one), XP simply does not have the new task scheduler version which schtasks manages. No surprise here that it simply won't work.
You can try doing the same with at.
While not ideal, you could also just copy the 'Schtasks' from XP and put it in another folder on the Windows 7 machine or put it in your 'System32' folder on the W7 box but rename it to 'XPSchedTask'. Then when you need to execute a scheduled task on a Windows XP box, you just call 'XPSchedTask' instead of 'SchedTask'

Resources