Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu > 12 error at logname #1

Open
stancufm opened this issue Jan 19, 2017 · 0 comments
Open

Ubuntu > 12 error at logname #1

stancufm opened this issue Jan 19, 2017 · 0 comments

Comments

@stancufm
Copy link

Hi,
First of all thank you for your great idea and awesome script, I've founded on Ubuntu forum.
I'm running Ubuntu 16.04 but as far as i have checked the script gave this error on almost every version above 12.04 because the terminal doesn't update login sessions.

./tail2notify
logname: no login name
ERROR
You must run this script as the user logged in to your desktop. You can't run
it as root unless root is logged into the desktop environment.

And to make sure you don't need to touch users space ( basically u need to hack the issue with the gnome terminal ), i have changed the line from your CHECK PRE-REQS, CONFIGURE ENV section:
elif [[ $(logname) != $USER ]]; then
with
elif [[ $(logname 2>/dev/null || echo ${SUDO_USER:-${USER}}) != $USER ]]; then
in this way you make sure your script don't rely on terminal updating the login sessions
Anyway i have some ideas how to add some more functionality to this script and maintain his charm but i will add those in the proper section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant