Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Atom does not start after running once as root due permission of /tmp/atom-nohup.out #3056

Closed
bentolor opened this issue Jul 23, 2014 · 14 comments
Assignees
Labels
bug linux Issues that occur on Linux but not on other platforms.

Comments

@bentolor
Copy link

Problem

Atom does no longer start after it has been run by root or probably any other user with a restrictive umask. This is because the atom.sh script pipes out the output to the same shared file /tmp/atom-nohup.out

Steps to reproduce

Run

 $ sudo su - root -c atom
 $ atom
 /usr/bin/atom: Zeile 84: /tmp/atom-nohup.out: Keine Berechtigung

The second call fails because nohup cannot write/access the file. This might work if root has a very permissive umask.

Solution

Probably atom should create and use tmp-Dirs per user, which is common style in Debian or at least allow global writing on the lofgile (hacky version).

@kevinsawicki
Copy link
Contributor

What do you think about storing it in ~/.atom/atom-nohup.out?

A similar issue happened when the compile cache was storing in the temp folder, that was moved to ~/.atom/compile-cache.

@bentolor
Copy link
Author

Sure! This is easy and would solve the problem.

Maybe it should start off a new file vs. appendng it to avoid endless growing of the log file. Or implement a minimal rotation of the previous ~/.atom/atom-nohup.out into ~/.atom/atom-nohup.out.1.

@bentolor
Copy link
Author

@kevinsawicki Thank you for the quick fix!

Just a moment ago I stumbled upon a similar issue, which is very related but much trickier, I guess. As a background: I do like atom so much, that I started it to use it as a drop-in replacement for gedit. Even to edit system configuration files. In this scenario it's quite common to invoke editors via sudo.

Atom will start in a broken state if you i.e. once launched sth. like a very common plain sudo atom /etc/hosts, because in this case $HOME still points the original user directory, though the process is started under root privileges. This seems to be a distribution specific default behavior of sudo. As result any file created in this Atom session will become unwriteable for the original user:

[30615:0724/202223:INFO:CONSOLE(29)] "Error: EACCES, permission denied '/home/ben/.atom/compile-cache/less/62b7a669af25a948e0632eac5cb2bf860f9c0e6e/imports.json'

To be honest: You are able run into similar issues on other programs too, but most of them tend not to create new files unless triggered. I'm not sure if there is an easy fix.

@kevinsawicki
Copy link
Contributor

@bentolor Mind creating a new issue for this?

halpin325 pushed a commit to halpin325/atom that referenced this issue Jul 26, 2014
Storing it in the temp directory can lead to permissions issues when
Atom is run by multiple users.

Closes atom#3056
@antuane
Copy link

antuane commented Aug 13, 2015

Its easy!

"sudo chmod 777 ~/.atom/atom-nohup.out"

@ksthiele
Copy link

Still not fixed for me

@ftcosta
Copy link

ftcosta commented Oct 18, 2016

Same here. Just reinstalling atom over itself did the trick.

wget -c https://github.com/atom/atom/releases/download/v1.11.2/atom-amd64.deb
sudo dpkg -i atom-amd64.deb
sudo rm atom-amd64.deb

@corysimmons
Copy link

corysimmons commented Jan 9, 2017

This is broke for me. Ran sudo atom ~/.zshrc now I can't use Atom like: atom .

sudo rm /home/foo/.atom/nohup.out fixes it for me.

@CasperHK
Copy link

I fixed it by:

sudo apt-get remove atom
sudo apt-get install atom

@xiuliren
Copy link

xiuliren commented Mar 6, 2017

these tricks do not work for me.

My atom can not be launched, get this error

/usr/bin/atom: line 130: 13875 Floating point exception(core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1

I can launch it using sudo, but lost a lot of features since the home is pointed to /root.

@DrWongKC
Copy link

sudo chmod 777 ~/.atom/atom-nohup.out <-- worked for me. I also deleted compile script.

@deejayingo
Copy link

deejayingo commented Aug 1, 2017

Thanks, that worked!! I did the following (starting on a blank ubuntu 17.04 without atom:

First installed atom:
sudo add-apt-repository ppa:webupd8team/atom
sudo apt update; sudo apt install atom

(Thanks to http://tipsonubuntu.com/2016/08/05/install-atom-text-editor-ubuntu-16-04/

Second I did the ftcosta stuff: (thanks man(or woman)):
wget -c https://github.com/atom/atom/releases/download/v1.11.2/atom-amd64.deb
sudo dpkg -i atom-amd64.deb
sudo rm atom-amd64.deb

Now I can open atom like this like gedit:
sudo atom ~/Downloads/test.txt

Hope I could help

@tagpro
Copy link

tagpro commented Oct 12, 2017

This worked for me

cd ~/.atom
chown -R -v <username> nohup.out 

@lock
Copy link

lock bot commented Apr 10, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked and limited conversation to collaborators Apr 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug linux Issues that occur on Linux but not on other platforms.
Projects
None yet
Development

No branches or pull requests