Zim

Is there a way to properly uninstall zim?

Asked by Zak McKracken

I installed zim on openSuse 11.3 as admin, worked fine (for the admin user)
Then tried to run as regular user, but zim apparently needs write access to some files in the installation directory (is there a way to change this?), so I installed it again, as a regular user, in a user directory, which also worked fine.

Now, whenever I try to start it, I have to explicitly type the path, and it will still try to access files in the original admin installation and then fails to even start up.

=> I'd like to remove the admin version of zim, but I see no uninstall option in setup.py, and manually deleting files (without getting further information) will certainly leave some remainders, since I've no idea where the installation put files, beyond the python directory

=> Bonus points if someone can give me a hint how to make the version installed by the admin work for every user, without allowing write acces to /usr/local/... directories

example (there are many more of these):
  File "/usr/local/lib/python2.6/site-packages/zim/fs.py", line 1310, in open
    raise FileWriteError, _('File is not writable') # T: Error message zim.fs.FileWriteError: File is not writable

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Zak McKracken
Solved:
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

On Sun, Apr 22, 2012 at 12:30 AM, Zak McKracken
<email address hidden> wrote:
> New question #194339 on Zim:
> https://answers.launchpad.net/zim/+question/194339
>
> I installed zim on openSuse 11.3 as admin, worked fine (for the admin user)
> Then tried to run as regular user, but zim apparently needs write access to some files in the installation  directory (is there a way to change this?), so I installed it again, as a regular user, in a user directory, which also worked fine.
>
> Now, whenever I try to start it, I have to explicitly type the path, and it will still try to access files in the original admin installation and then fails to even start up.
>
> => I'd like to remove the admin version of zim, but I see no uninstall option in setup.py,  and manually deleting files (without getting  further information) will certainly leave some remainders, since I've no idea where the installation put files, beyond the python directory

Typically there would be just the python files, an executable in
/usr/bin and data files in /usr/share/zim (or /usr/local/...). But
install paths will be distro specific, no idea about default config on
opensuse.

When installing is will print to the screen all files being installed,
have a look at this

> => Bonus points if someone can give me a hint how to make the version installed by the admin work for every user, without allowing write acces to /usr/local/... directories

In general zim should run without write access to the install folder.
In fact that is how I run it on Ubuntu all the time.

Maybe you can start telling me how you installed it - "./setup
install" or some other command ?

> example (there are many more of these):
>  File "/usr/local/lib/python2.6/site-packages/zim/fs.py", line 1310, in open
>    raise FileWriteError, _('File is not writable') # T: Error message zim.fs.FileWriteError: File is not writable

Would help to know which file this error is about - can you run in
debug mode (-D) and check the file being accessed ?

-- Jaap

Revision history for this message
Zak McKracken (zak-mckracken) said :
#2

Am Mon, 23 Apr 2012 11:15:41 +0200 hat Jaap Karssenberg
<email address hidden> geschrieben:

> Jaap Karssenberg proposed the following answer:
> On Sun, Apr 22, 2012 at 12:30 AM, Zak McKracken
> <email address hidden> wrote:
>> New question #194339 on Zim:
>> https://answers.launchpad.net/zim/+question/194339
>>
>> => Bonus points if someone can give me a hint how to make the version
>> installed by the admin work for every user, without allowing write
>> access
>> to /usr/local/... directories
>
> In general zim should run without write access to the install folder.
> In fact that is how I run it on Ubuntu all the time.
>
> Maybe you can start telling me how you installed it - "./setup
> install" or some other command ?

I changed to superuser in the shell, then executed ./setup.py install
as it says in the install guidelines.
for the userspace installation I used ./setup.py install
--prefix="~/something",

> Would help to know which file this error is about - can you run in
> debug mode (-D) and check the file being accessed ?

Sure. The complete message is in the attachment.
After reading it again, It looks to me I misinterpreted something when
writing the first question. But the problem remains that there's something
that cannot be written...

I've checked the hard drive space (several hundred GB free), and my
~/.local/share and ~/.config directories (mentioned in the debug output)
exist and are being used by a number of other applications. but neither
contains any files with *zim* in their names. In the admin's home
directory there's ~/.config/zim/

... belay that -- it works now!

Here's what I did: Initially I somehow misread the error message to mean
that zim tried to write /usr/local/lib/python2.6/site-packages/zim/fs.py
Which is of course not true. So I opened fs.py and daemon.py to find out
what they do, found that the filename is assigned in line 90 in daemon.py
(pidfile). I added a simple print statement to tell me the filename (great
knowing at least a bit python!).

soo, apparently zim has managed to create a directory /tmp/zim-zak/ which
belongs to the administrator! next to it was /tmp/zim-root/, which is as
it should be, but as a regular user, I could not access the directory
/tmp/zim-zak anymore. I just removed it as root, and now zim works
normally and has just created a new one owned by me.

I have no idea whether I did something completely wrong when first
starting zim from the admin account, or what I have done that created a
/tmp dir owned by root with my user name...

If others have similar problems, there might be something wrong in zim, if
not, it was probably just me :(

Thanks for your time, and also thanks for zim. I hope it'll do what I hope
it will ;)

  Zak

Revision history for this message
Zak McKracken (zak-mckracken) said :
#3

It seems to formally close the issue, I need to write something via the web interface (last message was via e-mail).
So there you go, it's solved. Thanks again.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#4

On Mon, Apr 23, 2012 at 3:31 PM, Zak McKracken
<email address hidden> wrote:
> soo, apparently zim has managed to create a directory /tmp/zim-zak/ which
> belongs to the administrator! next to it was /tmp/zim-root/, which is as
> it should be, but as a regular user, I could not access the directory
> /tmp/zim-zak anymore. I just removed it as root, and now zim works
> normally and has just created a new one owned by me.

Hmm at least that explains the error.

> I have no idea whether I did something completely wrong when first
> starting zim from the admin account, or what I have done that created a
> /tmp dir owned by root with my user name...

I would guess that when you were logged in as superuser the $USER in
your shell environment was still set to "zak", which kind of makes
sense, but is not something I thought about before.

> If others have similar problems, there might be something wrong in zim, if
> not, it was probably just me :(

Well, I actually never tested runnign zim as root, and not really
expect(ed) a desktop application to be run as superuser.

> Thanks for your time, and also thanks for zim. I hope it'll do what I hope
> it will ;)

Revision history for this message
Zak McKracken (zak-mckracken) said :
#5

Am Mon, 23 Apr 2012 16:00:58 +0200 hat Jaap Karssenberg
<email address hidden> geschrieben:

> Your question #194339 on Zim changed:
> https://answers.launchpad.net/zim/+question/194339
>
> Jaap Karssenberg posted a new comment:
[...]
>> I have no idea whether I did something completely wrong when first
>> starting zim from the admin account, or what I have done that created a
>> /tmp dir owned by root with my user name...
>
> I would guess that when you were logged in as superuser the $USER in
> your shell environment was still set to "zak", which kind of makes
> sense, but is not something I thought about before.

Ah, this makes sense:

/home/zak> echo $USER
zak
/home/zak> su
Passwort:
mycomputer:/home/zak # echo $USER
zak
mycomputer:/home/zak # whoami
root
mycomputer:/home/zak # exit
exit
/home/zak> sudo tcsh
root's password:
mycomputer:/home/zak# echo $USER
root
mycomputer:/home/zak# whoami
root

I did not start a new shell as root, just su'd.
I then ran setup install and in order to see whether it runs, just started
zim once right then and there, as root.

> Well, I actually never tested runnign zim as root, and not really
> expect(ed) a desktop application to be run as superuser.

I didn't plan to, but I didn't assume it would be a problem either.
Also, didn't think that it would make any difference whether I start a new
shell as root or just go superuser.
That's one of the intricacies of Linux I wasn't aware of, I guess.

I guess having proper packages would solve this completely (along with the
"how do I ununstall zim" problem), but I am aware that means lots of
distro-specific work.

Anyway, I learnt a lot today, so that's good :)

  Cheers,

       Zak