all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to install emacs server on ubuntu
@ 2009-11-25 23:06 n179911
  2009-11-26  5:38 ` tomas
  2009-11-26 20:50 ` Sven Bretfeld
  0 siblings, 2 replies; 11+ messages in thread
From: n179911 @ 2009-11-25 23:06 UTC (permalink / raw
  To: help-gnu-emacs

Hi,
I read this follow wiki entry trying to install emacs server on ubuntu:
http://www.emacswiki.org/emacs/EmacsClient#toc5

I have download the following script and cp it to /etc/init.d/emacsd
http://www.emacswiki.org/emacs/EmacsdInitScript

And I restart my ubuntu, and I run 'emacsclient'.
I still get:
$  emacsclient
emacsclient: file name or argument required
Try `emacsclient --help' for more information

Thank you for your help.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-25 23:06 How to install emacs server on ubuntu n179911
@ 2009-11-26  5:38 ` tomas
  2009-11-26  8:35   ` n179911
  2009-11-26 18:35   ` Richard Riley
  2009-11-26 20:50 ` Sven Bretfeld
  1 sibling, 2 replies; 11+ messages in thread
From: tomas @ 2009-11-26  5:38 UTC (permalink / raw
  To: n179911; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Nov 25, 2009 at 03:06:36PM -0800, n179911 wrote:
> Hi,
> I read this follow wiki entry trying to install emacs server on ubuntu:
> http://www.emacswiki.org/emacs/EmacsClient#toc5
> 
> I have download the following script and cp it to /etc/init.d/emacsd
> http://www.emacswiki.org/emacs/EmacsdInitScript
> 
> And I restart my ubuntu, and I run 'emacsclient'.
> I still get:
> $  emacsclient
> emacsclient: file name or argument required
> Try `emacsclient --help' for more information

Well? Did you try ;-)

Thing is that the client needs a cookie file to know "where" the server
is (and to show the server that it's allowed to). So, provided this
server is running, it has put this cookie file somewhere (typically in
your home dir, in emacs.d/server/server). I don't know how Ubuntu
customizes this in partticular.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLDhRBBcgs9XrR2kYRAssFAJ9wIKj9igqkLUCLZQFaMT0oN/eZUACfZG6e
Z+9MKt6IL5rcQliLxjkZuZM=
=s32I
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26  5:38 ` tomas
@ 2009-11-26  8:35   ` n179911
  2009-11-26  8:58     ` tomas
  2009-11-26 18:35   ` Richard Riley
  1 sibling, 1 reply; 11+ messages in thread
From: n179911 @ 2009-11-26  8:35 UTC (permalink / raw
  To: tomas; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

I tried following this, I want emacs daemon starts/kills automatically:
http://www.emacswiki.org/emacs/emacsd, which I did this (as root).

   1. cp emacsd /etc/init.d/
   2. chmod 755 /etc/init.d/emacsd
   3. update-rc.d emacsd defaults

But I still get this error when I
$ emacsclient -c examples.desktop
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: error executing alternate editor "emacs -Q"

Thank you for any help.



On Wed, Nov 25, 2009 at 9:38 PM, <tomas@tuxteam.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, Nov 25, 2009 at 03:06:36PM -0800, n179911 wrote:
> > Hi,
> > I read this follow wiki entry trying to install emacs server on ubuntu:
> > http://www.emacswiki.org/emacs/EmacsClient#toc5
> >
> > I have download the following script and cp it to /etc/init.d/emacsd
> > http://www.emacswiki.org/emacs/EmacsdInitScript
> >
> > And I restart my ubuntu, and I run 'emacsclient'.
> > I still get:
> > $  emacsclient
> > emacsclient: file name or argument required
> > Try `emacsclient --help' for more information
>
> Well? Did you try ;-)
>
> Thing is that the client needs a cookie file to know "where" the server
> is (and to show the server that it's allowed to). So, provided this
> server is running, it has put this cookie file somewhere (typically in
> your home dir, in emacs.d/server/server). I don't know how Ubuntu
> customizes this in partticular.
>
> Regards
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFLDhRBBcgs9XrR2kYRAssFAJ9wIKj9igqkLUCLZQFaMT0oN/eZUACfZG6e
> Z+9MKt6IL5rcQliLxjkZuZM=
> =s32I
> -----END PGP SIGNATURE-----
>

[-- Attachment #2: Type: text/html, Size: 2823 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26  8:35   ` n179911
@ 2009-11-26  8:58     ` tomas
  2009-11-26 18:09       ` n179911
  0 siblings, 1 reply; 11+ messages in thread
From: tomas @ 2009-11-26  8:58 UTC (permalink / raw
  To: n179911; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Nov 26, 2009 at 12:35:09AM -0800, n179911 wrote:
> I tried following this, I want emacs daemon starts/kills automatically:
> http://www.emacswiki.org/emacs/emacsd, which I did this (as root).

Meh. This init script is nice and all -- but so un-unixy that I want to
cry ;-)

> 
>    1. cp emacsd /etc/init.d/
>    2. chmod 755 /etc/init.d/emacsd
>    3. update-rc.d emacsd defaults

Did you copy it as-is? Then you'd have to make sure that you are user
1000 on the system.

You can find out by typing the command id into a shell.

> But I still get this error when I
> $ emacsclient -c examples.desktop
> emacsclient: can't find socket; have you started the server?
> To start the server in Emacs, type "M-x server-start".
> emacsclient: error executing alternate editor "emacs -Q"

As already stated, you have to provide emacsclient with a file which

 (a) gives it a hint on how to contact the server
 (b) gives it the authority to do so.

Typically, the server makes this file at start.

What's in this "example.desktop" file? 

Basically, I think it's not a good idea to start the server from init.d
- -- it's a user thing, so it should be started on user session.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLDkMbBcgs9XrR2kYRAt7KAJ0cjuXzSzX1o4vTowLxISUNTTJA/ACdHe0h
qH/QRTeBQyu4cRyC4pQN5nI=
=7K/3
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26  8:58     ` tomas
@ 2009-11-26 18:09       ` n179911
  2009-11-27  5:29         ` tomas
  0 siblings, 1 reply; 11+ messages in thread
From: n179911 @ 2009-11-26 18:09 UTC (permalink / raw
  To: tomas; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On Thu, Nov 26, 2009 at 12:58 AM, <tomas@tuxteam.de> wrote:
>
>
> Basically, I think it's not a good idea to start the server from init.d
> - -- it's a user thing, so it should be started on user session.
>
> Thank you. Tomas.

How can I unstall the script?
>    1. cp emacsd /etc/init.d/
>    2. chmod 755 /etc/init.d/emacsd
>    3. update-rc.d emacsd defaults

I did the last step 'update-rc.d', how can I reverse the change done by that
'update-rc.d' script?

Thank you.

[-- Attachment #2: Type: text/html, Size: 1496 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26  5:38 ` tomas
  2009-11-26  8:35   ` n179911
@ 2009-11-26 18:35   ` Richard Riley
  1 sibling, 0 replies; 11+ messages in thread
From: Richard Riley @ 2009-11-26 18:35 UTC (permalink / raw
  To: help-gnu-emacs

tomas@tuxteam.de writes:

> On Wed, Nov 25, 2009 at 03:06:36PM -0800, n179911 wrote:
>> Hi,
>> I read this follow wiki entry trying to install emacs server on ubuntu:
>> http://www.emacswiki.org/emacs/EmacsClient#toc5
>>
>> I have download the following script and cp it to /etc/init.d/emacsd
>> http://www.emacswiki.org/emacs/EmacsdInitScript
>>
>> And I restart my ubuntu, and I run 'emacsclient'.
>> I still get:
>> $  emacsclient
>> emacsclient: file name or argument required
>> Try `emacsclient --help' for more information
>
> Well? Did you try ;-)
>
> Thing is that the client needs a cookie file to know "where" the server
> is (and to show the server that it's allowed to). So, provided this
> server is running, it has put this cookie file somewhere (typically in
> your home dir, in emacs.d/server/server). I don't know how Ubuntu
> customizes this in partticular.

By far the easiest, and oft overlooked, method to start the server is to
use the alternative-editor parameter. My EDITOR env is ~/bin/edit where
"edit" is the following simply bash script:

,----
| #!/bin/bash
| # edit
| export GDK_NATIVE_WINDOWS=1
| exec emacsclient --alternate-editor="" -c "$@"
`----

emacsclient will start the daemon if it's not already started.






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-25 23:06 How to install emacs server on ubuntu n179911
  2009-11-26  5:38 ` tomas
@ 2009-11-26 20:50 ` Sven Bretfeld
  2009-11-26 21:14   ` Richard Riley
  1 sibling, 1 reply; 11+ messages in thread
From: Sven Bretfeld @ 2009-11-26 20:50 UTC (permalink / raw
  To: n179911; +Cc: help-gnu-emacs

Hi

n179911 <n179911@gmail.com> writes:

> I have download the following script and cp it to /etc/init.d/emacsd
> http://www.emacswiki.org/emacs/EmacsdInitScript

I really don't see the advantage of this script. I've also tried it
once. I merely start the daemon once I log in with 'emacs --daemon'
under Ubuntu Karmic, and that's it. You can also let that command be
executed by an auto-start script under Gnome, KDE or whatever. Once the
daemon is started, you can do 'emacsclient -c' either by using alt-F2 or
with a prepared icon.

By the way, under Ubuntu you have to take care that you start the
correct version of the client fitting to the version of the server,
since you might have more than one Emacs version installed (emacs22,
emacs23 and emacs-snapshot are available in the standard repo). In case
you have, you should start daemon and client with 'emacs.emacs-snapshot
--daemon' etc.

Good luck

Sven




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26 20:50 ` Sven Bretfeld
@ 2009-11-26 21:14   ` Richard Riley
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Riley @ 2009-11-26 21:14 UTC (permalink / raw
  To: help-gnu-emacs

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> Hi
>
> n179911 <n179911@gmail.com> writes:
>
>> I have download the following script and cp it to /etc/init.d/emacsd
>> http://www.emacswiki.org/emacs/EmacsdInitScript
>
> I really don't see the advantage of this script. I've also tried it
> once. I merely start the daemon once I log in with 'emacs --daemon'
> under Ubuntu Karmic, and that's it. You can also let that command be
> executed by an auto-start script under Gnome, KDE or whatever. Once the
> daemon is started, you can do 'emacsclient -c' either by using alt-F2 or
> with a prepared icon.
>
> By the way, under Ubuntu you have to take care that you start the
> correct version of the client fitting to the version of the server,
> since you might have more than one Emacs version installed (emacs22,
> emacs23 and emacs-snapshot are available in the standard repo). In case
> you have, you should start daemon and client with 'emacs.emacs-snapshot
> --daemon' etc.

Alternatively use update-alternatives

>
> Good luck
>
> Sven
>

-- 





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-26 18:09       ` n179911
@ 2009-11-27  5:29         ` tomas
  2009-11-28  8:34           ` n179911
  0 siblings, 1 reply; 11+ messages in thread
From: tomas @ 2009-11-27  5:29 UTC (permalink / raw
  To: n179911; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Nov 26, 2009 at 10:09:13AM -0800, n179911 wrote:
> On Thu, Nov 26, 2009 at 12:58 AM, <tomas@tuxteam.de> wrote:
> >
> >
> > Basically, I think it's not a good idea to start the server from init.d
> > - -- it's a user thing, so it should be started on user session.
> >
> > Thank you. Tomas.
> 
> How can I unstall the script?
> >    1. cp emacsd /etc/init.d/
> >    2. chmod 755 /etc/init.d/emacsd
> >    3. update-rc.d emacsd defaults
> 
> I did the last step 'update-rc.d', how can I reverse the change done by that
> 'update-rc.d' script?

With 'update-rc.d' itself: just type

  update-rc.d emacsd remove

Note that it won't delete the script in /etc/init.d/emacsd. It will set
up things so that in won't be called at start/stop of the system.

(You can learn such things by invoking the manual page of update-rc.d:
just type at a terminal window: "man update-rc.d").

Did you investigate the other avenues? Do you now know why it didn't
work?

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLD2O9Bcgs9XrR2kYRAmXQAJ9K+gD5yuFNVweTLZ064e6SrbHjsgCff6lE
33/6jTBv3AmC3EjxU98lJlo=
=PjMV
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-27  5:29         ` tomas
@ 2009-11-28  8:34           ` n179911
  2009-11-28 11:16             ` tomas
  0 siblings, 1 reply; 11+ messages in thread
From: n179911 @ 2009-11-28  8:34 UTC (permalink / raw
  To: tomas; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]

Thank you Tomas.

I use this way, which works for me:

My EDITOR env is ~/bin/edit where
"edit" is the following simply bash script:

,----
| #!/bin/bash
| # edit
| export GDK_NATIVE_WINDOWS=1
| exec emacsclient --alternate-editor="" -c "$@"
`----

emacsclient will start the daemon if it's not already started.

On Thu, Nov 26, 2009 at 9:29 PM, <tomas@tuxteam.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, Nov 26, 2009 at 10:09:13AM -0800, n179911 wrote:
> > On Thu, Nov 26, 2009 at 12:58 AM, <tomas@tuxteam.de> wrote:
> > >
> > >
> > > Basically, I think it's not a good idea to start the server from init.d
> > > - -- it's a user thing, so it should be started on user session.
> > >
> > > Thank you. Tomas.
> >
> > How can I unstall the script?
> > >    1. cp emacsd /etc/init.d/
> > >    2. chmod 755 /etc/init.d/emacsd
> > >    3. update-rc.d emacsd defaults
> >
> > I did the last step 'update-rc.d', how can I reverse the change done by
> that
> > 'update-rc.d' script?
>
> With 'update-rc.d' itself: just type
>
>  update-rc.d emacsd remove
>
> Note that it won't delete the script in /etc/init.d/emacsd. It will set
> up things so that in won't be called at start/stop of the system.
>
> (You can learn such things by invoking the manual page of update-rc.d:
> just type at a terminal window: "man update-rc.d").
>
> Did you investigate the other avenues? Do you now know why it didn't
> work?
>
> Regards
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFLD2O9Bcgs9XrR2kYRAmXQAJ9K+gD5yuFNVweTLZ064e6SrbHjsgCff6lE
> 33/6jTBv3AmC3EjxU98lJlo=
> =PjMV
> -----END PGP SIGNATURE-----
>

[-- Attachment #2: Type: text/html, Size: 2520 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to install emacs server on ubuntu
  2009-11-28  8:34           ` n179911
@ 2009-11-28 11:16             ` tomas
  0 siblings, 0 replies; 11+ messages in thread
From: tomas @ 2009-11-28 11:16 UTC (permalink / raw
  To: n179911; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Nov 28, 2009 at 12:34:36AM -0800, n179911 wrote:
> Thank you Tomas.
> 
> I use this way, which works for me:
> 
> My EDITOR env is ~/bin/edit where
> "edit" is the following simply bash script:

[...]

> emacsclient will start the daemon if it's not already started.

Yes, to me this makes much more sense than starting in /etc/init.d.

Alternatively, if you want to be spared the waiting time for the first
invocation, you could do the server-starting business at the start of
your "session" (i.e. when your desktop environment is started or on your
(first) login shell).

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLEQaMBcgs9XrR2kYRAqfuAJ9hYNYWLBUU7rYLxDy8f2rCMiLJlgCggYk/
GtvKuj0c8Q3xQv+ZHlgKFVM=
=5rk7
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-11-28 11:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 23:06 How to install emacs server on ubuntu n179911
2009-11-26  5:38 ` tomas
2009-11-26  8:35   ` n179911
2009-11-26  8:58     ` tomas
2009-11-26 18:09       ` n179911
2009-11-27  5:29         ` tomas
2009-11-28  8:34           ` n179911
2009-11-28 11:16             ` tomas
2009-11-26 18:35   ` Richard Riley
2009-11-26 20:50 ` Sven Bretfeld
2009-11-26 21:14   ` Richard Riley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.