Dropbox doesn’t start (Linux)

So a quick note regarding Dropbox running on ArchLinux with Nvidia drivers. Since I use KDE Plasma 5 that doesn’t show system tray icons of some applications that have not migrated to the new system tray protocol, I didn’t notice that after upgrading Dropbox it stopped working.

A quick investigation, I’ve found out that starting Dropbox from the command line did nothing. It started and stopped. Something is going on…

So I’ve used the strace command to see if I could catch something meaningful:

[pcortex@pcortex:~]$ cd .dropbox-dist/dropbox-lnx.x86_64-3.10.8/
[pcortex@pcortex:dropbox-lnx.x86_64-3.10.8]$ strace ./dropbox 2> stracedump.txt

And sure enough in the stracedump.txt I had the following error:

open("/usr/lib/dri/tls/swrast_dri.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/dri/swrast_dri.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
rt_sigaction(SIGSEGV, {0x7f09e1dea010, [SEGV], SA_RESTORER|SA_RESTART, 0x7f09e1a88d60}, NULL, 8) = 0
write(4, "Fatal Python error: ", 20)    = 20
write(4, "Segmentation fault", 18)      = 18
write(4, "\n\n", 2)                     = 2
write(4, "Traceback (most recent call firs"..., 36) = 36
write(4, "  File ", 7)                  = 7
write(4, "\"", 1)                       = 1
write(4, "d", 1)                        = 1

So the error is related to the Software Raster library, that I don’t have because I’m running Nvidia proprietary drivers.

The confirmation came with the following command:

[pcortex@pcortex:dropbox-lnx.x86_64-3.10.8]$ LIBGL_DEBUG=verbose ./dropbox
libGL: OpenDriver: trying /usr/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/dri/swrast_dri.so
libGL error: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: reverting to indirect rendering

The solution?
Quite simple, just remove (backup) the libGL.so.1 library that exists on the Dropbox directory.
After the removal, Dropbox starts just fine.

Advertisements

Private Dokuwiki on multiple computers using Dropbox

Dropbox is a great tool, and due to it’s file sync capabilities it has a lot of possibilities to create “hack” solutions like the one that I’m going to describe here:

If you have a personal Wiki that you want to share between several computers, the usual “normal” way of doing so is to setup a 24/7 Web Server with Apache/Lighttpd and, in my case, installing Dokuwiki. Then the client PC’s to access the Wiki all they have to do is tto point their browser to access this web server. But what this means is that you really need to have a web server available 24/7 even  if not using it… And where to locate this web server? At my home? Pay hosting fees? And if I don’t have connection to it? And so on…

The solution is using Dropbox as your data repository for DokuWiki Content. Content is always available and replicated automatically on all computers, even if you don’t have internet access. You can even share your Wiki privately with your friends/family/colleagues by inviting them to the Wiki folder… and off course setting up Lighttpd on their computers.

How it works:

I’m using Lighttpd as the web server. For personal use is more than enough and it supports PHP5 and Dokuwiki just fine. Lighthttpd is installed in all computers that access the wiki.

The installation steps for Ubuntu/Kubuntu and derivatives are the following:

1) Install Lighttpd, php5 and dokuwiki packages: apt-get install lighttpd php5-cgi dokuwiki.

During installation of dokuwiki, it will be asked what web server should be configured automatically, namely Apache or lighttpd. We must choose the later, lighttpd by pressing space (so that a * should appear) and, if Apache is not installed, deselect Apache.

The following question is if, in case of dokuwiki package removal, should the wiki content ALSO be removed… We should answer NO.

Then, finally, the wiki admin password is asked.

After installation, the lighttpd server should start automatically, and using a browse the local web page http://localhost should show the default web server page.

Then follow these instructions http://redmine.lighttpd.net/wiki/lighttpd/TutorialLighttpdAndPHP#Configuration to enable Lighttpd with PHP5.

Basically is to edit the php.ini file that’slocated in /etc/php5/cgi/php.ini and the lighttpd.conf file located on /etc/lighttpd directory. These changes must be done as the user root (use sudo -s on a command shell).

Make sure that when pasting the fastcgi.server section into the lighttpd.conf file, the “bin-path” entry points to the php5-cgi binary, normally located at /usr/bin/php5-cgi

Save and restart the lighttpd server with the command /etc/init.d/lighttpd restart


2) Copy /usr/share/dokuwiki to /var/www with the following command:  cp -R /usr/share/dokuwiki /var/www and make sure the permissions are correct: chown -R www-data:www-data /var/www/dokuwiki

Note that the first copy command there are no trailing slashes.

3) You can rename the folder from dokuwiki to other name, like wiki, for example to change the URL. This is optional.

4) Create the Dokuwiki data directory on your Dropbox: mkdir -p ~/Dropbox/wiki/data This should be done in only ONE computer, the others will synchronize automatically.


5) Change the permissions on the directory: sudo chown -R www-data ~/Dropbox/wiki/data This should be done in ALL computers.

6) Edit the Dokuwiki configuration file dokuwiki.php located in /etc/dokuwiki and change the value of the line $conf[‘savedir’] to the data location on the dropbox folder. In my case I changed the default value from $conf[‘savedir’]=’/var/lib/dokuwiki/data’; to $conf[‘savedir’]=’/home/primalcortex/Dropbox/wiki/data’;

You must do this in all computers, only, probably, changing the Dropbox location. If you’re using the same username on all computers, just copy the file between them using Dropbox…

And that’s it. Accessing now the URL http://localhost/dokuwiki uses now the local lighttpd web server with all data synchronized between computers, and it works EVEN when offline. 

You now can invite your work colleagues to this folder, and have all data available at all times to anyone that uses the same scheme.

EDIT: You may find the following error when using the Wiki based on your Dropbox directory: The datadir (‘pages‘) does not exist, isn’t accessible or writable. You should check your config and permission settings.

The problem is file/directory permissions, because the user www-data used by lighttpd can’t access your home directory/Dropbox directory.

There are two solutions, being the easy one to add the www-data user to your own group, in my case the group named primalcortex.

The other solution is to add the following permissions: chmod o+x /home/username and chmod o+x/home/Dropbox

The first solution will be better because Dropbox software can or might change the Dropbox directory permissions. Just make sure that your home directory permissions are 750.

Firefox and Dropbox syncronization for Bookmarks and Passwords

EDIT: Mozilla Weave is OK now and I fully use it. No hacks anymore, so the rest of this post is here for historical reasons: Just use Mozilla Weave.

After upgrading from Mozilla FireFox 3.0 to 3.5 I tried Mozilla Weave for syncing my bookmarks and passwords in all my computers. I was using version 0.8 (1.0b1 is out now), but despite working more or less, most of my bookmarks where misplaced, put out of order, moved to unsorted bookmarks… a mess. Tiding up the bookmarks on one browser doesn’t mean that it would be ok on another, so after only 5 days of use, I thought that there is probably a better solution, and I found it.

The solution is to use Dropbox https://www.dropbox.com/referrals/NTE1NTQzMTA5, the FireFox Addon SyncPlaces: http://www.andyhalford.com/syncplaces/ for synchronizing bookmarks and passwords. It works as it should. It doesn’t mess with Bookmarks, the order is kept, Icons are kept, and passwords are synchronized without any issue.

So, what are the steps:

– Install Dropbox and create an account.

– Install the Syncplaces add-on for Firefox

– Create a directory for storing Firefox information on your Dropbox folder, for example: mkdir ~/Dropbox/Firefox

– On your Firefox menu, goto Bookmarks->Syncplaces->options

– Select the Server tab and then select on the Connection sub-tab, the protocol File

– Select now the Syncronization tab, and define the path for the files: prefix the suggested name with /home/primalcortex/Dropbox/Firefox. So it should look like

JSON PATH: /home/primalcortex/Dropbox/Firefox/syncplaces.json

If you want, you can output also in HTML and XBEL format. Use the same path for the files.

– For synchronizing passwords select the check-box passwords, and input a strong password. The password path is like the previous ones: /home/primalcortex/Dropbox/Firefox/passwords

You’re set. So down on the FireFox status bar, there is now an icon with a blue and red lines/circles, right click on it and select Send Bookmarks/passwords. Make sure that on the Dropbox Firefox folder files where created. Now DropBox synchronizes these files into the “cloud”, and they are available to your other Dropbox computers.

On the other computers, just repeat the configuration process (Install Dropbox, SyncPlaces, same configuration) but this time select on those computers on the SyncPlaces icon, the Receive Bookmarks/passwords option. (Make sure that you use the same password for the password export/impor feature in all computers).

Voilá, full no fuss workable synchronization! You just decide now which is the master machine, if you want to, namely by tweaking the merge options of the Syncplaces Addon. Also to avoid bookmarks duplication, I recommend that the BookmarkDD addon at http://bookmarkdd.mozdev.org/installation.html be installed and set not to do pop-ups when duplicated bookmarks are found. This way, during import, no duplicate bookmarks are imported.

Now you can automate the synchronization process by just configuring Syncplaces to synchronize at a specific time, or periodically/automatically and your set.