Fix recursive symlink in CentOS rpm pkg
https://gist.github.com/sf-mrichter/3da608bbcd93ee79a1277a1632f32c39
Cannot reproduce. From a freshly built RPM install on our Docker images:
[build@29a9c41669ee ~]$ sudo rpm -i couchdb-2.1.1-1.el7.centos.x86_64.rpm
[build@29a9c41669ee ~]$ ls -la /var/lib/couchdb
total 8
drwxr-xr-x 2 couchdb couchdb 4096 Nov 7 08:13 .
drwxr-xr-x 28 root root 4096 Nov 7 10:14 ..
And on CentOS 6:
[build@60e8d5869dea ~]$ sudo /opt/couchdb/bin/couchdb
^Z
[1]+ Stopped sudo /opt/couchdb/bin/couchdb
[build@60e8d5869dea ~]$ bg
[1]+ sudo /opt/couchdb/bin/couchdb &
[build@60e8d5869dea ~]$ curl localhost:5984
{"couchdb":"Welcome","version":"2.1.1","features":["scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
[build@60e8d5869dea ~]$ curl -X PUT localhost:5984/foo
{"ok":true}
[build@60e8d5869dea ~]$ curl -X PUT localhost:5984/bar
{"ok":true}
[build@60e8d5869dea ~]$ ls /var/lib/couchdb
_dbs.couch _nodes.couch _replicator.couch shards _users.couch
[build@60e8d5869dea ~]$ ls -la /var/lib/couchdb
total 72
drwxr-xr-x 5 couchdb couchdb 4096 Nov 7 10:17 .
drwxr-xr-x 23 root root 4096 Nov 7 10:16 ..
-rw-r--r-- 1 root root 12474 Nov 7 10:17 _dbs.couch
drwxr-xr-x 2 root root 4096 Nov 7 10:17 .delete
-rw-r--r-- 1 root root 8372 Nov 7 10:17 _nodes.couch
-rw-r--r-- 1 root root 8378 Nov 7 10:17 _replicator.couch
drwxr-xr-x 10 root root 4096 Nov 7 10:17 shards
-rw-r--r-- 1 root root 8378 Nov 7 10:17 _users.couch
drwxr-xr-x 3 root root 4096 Nov 7 10:17 ._users_design
[build@60e8d5869dea ~]$ ls -R /var/lib/couchdb
/var/lib/couchdb:
_dbs.couch _nodes.couch _replicator.couch shards _users.couch
/var/lib/couchdb/shards:
00000000-1fffffff 40000000-5fffffff 80000000-9fffffff c0000000-dfffffff
20000000-3fffffff 60000000-7fffffff a0000000-bfffffff e0000000-ffffffff
/var/lib/couchdb/shards/00000000-1fffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/20000000-3fffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/40000000-5fffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/60000000-7fffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/80000000-9fffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/a0000000-bfffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/c0000000-dfffffff:
bar.1510049847.couch foo.1510049845.couch
/var/lib/couchdb/shards/e0000000-ffffffff:
bar.1510049847.couch foo.1510049845.couch
Only possibility is that this is a systemd thing, and I need a real CentOS7 box on which to test it.
🤷♀️
@sf-mrichter are you still seeing this symlink issue in your systems? if so can you let me know the exact scenario under which it appears? what OS, what version, when does it occur, etc?
Thanks for asking. No, I don't see this anymore. We've upgraded to 2.1 and have had no such issues since.
Cheers!
OK, we have another report on this. It appears to be related to upgrades only:
16:17 < mhaggel> another minor issue I observed during the update (is my first
one) is that although the /var/lib/couchdb exists, the update
creates a new softlink /var/lib/couchdb/couchdb ->
/var/lib/couchdb
16:18 < mhaggel> same is true with the /var/log/couchdb/couchdb ->
/var/log/couchdb