LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-24-2009, 05:47 AM   #1
moazam
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Memcached startup script


Hello,
I am totally new to linux world. I am trying to configure memcached on centos but its throwing me two error. I was wondering if someone here could help me on this.

I am following startup script from here http://www.vbseo.com/blogs/danny-bem...-memcached-44/

when I try to run this
[root@host]# /etc/init.d/memcached restart

it throws me this error
: bad interpreter: No such file or directory

i also tried sh command and then it gave this error
: No such file or directory 14: /etc/rc.d/init.d/functions

i just commented this line then i was keep getting : numeric argument required 22: exit: 0 error.

Please let me know what I am doing wrong. I saw httpd file it had also similar code and I checked this file /etc/rc.d/init.d/functions its on same place.

Any help would be much appreciated.

Thanks,
Moazam
 
Old 07-24-2009, 06:44 AM   #2
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
(edited)

Apologies, didnt read your post right - im not awake yet!

So assuming the interpreter is set, and youre running as root, have you checked that the file exists in the place the script is looking for it?

Last edited by dxangel; 07-24-2009 at 06:52 AM.
 
Old 07-24-2009, 06:48 AM   #3
moazam
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dxangel View Post
Do have this line in your script? needs to be the first line:

Code:
#!/bin/bash
ETA:

secondly, are you running the script as root?
1) I don't know, but I checked httpd file it had also same line. How do I check this?

2) Yes running as root
 
Old 07-24-2009, 06:58 AM   #4
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
this should also help you

http://www.linuxquestions.org/questi...preter-204902/
 
Old 07-24-2009, 07:17 AM   #5
moazam
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dxangel View Post
tried this command unix2dos /etc/init.d/memcached but didn't work

memcached file is already chmod 0755
 
Old 07-24-2009, 07:24 AM   #6
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

If you want to use the script on a linux box and 'wrote' it in Windows environment you'll have to use dos2unix instead of unix2dos.

If you open the file with vi -b (for binary and executable files) and you see things like ^M at the end of each line, that's when you need to either delete those characters or run the dos2unix command.

Kind regards,

Eric
 
Old 07-24-2009, 07:29 AM   #7
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
i think you mean dos2unix? not unix2dos.
 
Old 07-24-2009, 07:58 AM   #8
moazam
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EricTRA View Post
Hi,

If you want to use the script on a linux box and 'wrote' it in Windows environment you'll have to use dos2unix instead of unix2dos.

If you open the file with vi -b (for binary and executable files) and you see things like ^M at the end of each line, that's when you need to either delete those characters or run the dos2unix command.

Kind regards,

Eric
Excellent worked fine.. just had a little problem while converting file by using this command dos2unix

i was using dos2unix /etc/init.d/memcached it was giving me an error.. i googled and found i have to first change directory to init.d and then run this command.

Thanks everyone for helping me on this.
 
Old 07-24-2009, 08:36 AM   #9
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
glad to help.
 
Old 07-25-2009, 01:23 AM   #10
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
You're welcome. Glad to be of assistance.

Kind regards,

Eric
 
  


Reply

Tags
interpreter


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Is Memcached a Good or Bad Sign for MySQL? LXer Syndicated Linux News 0 05-17-2009 06:11 PM
LXer: Gear6 to Launch Industry's First Memcached Solution on April 20 LXer Syndicated Linux News 0 04-14-2009 04:30 AM
LXer: Installing memcached And The PHP5 memcache Module On Debian Etch (Apache2) LXer Syndicated Linux News 0 09-11-2008 02:20 PM
Haproxy ,memcached ,mysql strange problem Eazy-Snatch Linux - Server 1 05-14-2008 02:54 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM


All times are GMT -5. The time now is 01:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration