Skip to content

Commit

Permalink
Add example of unit file. It could be used during system upgrade to
Browse files Browse the repository at this point in the history
convert the database automatically
  • Loading branch information
fila43 committed Aug 4, 2023
1 parent 484aaac commit d91fc7e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ GDBM is the default one. LMDB needs to have created directory for database files

`./db_convert --src access.db --dest lmdb --lmdb`
* Your new file with converted database will be created

### Example systemd service
The directory `units` contains example of the service file. It could be used as template
for database conversion within system upgrade.
13 changes: 13 additions & 0 deletions units/libdb-convert.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Convert libdb(BerkeleyDB) database
After=local-fs.target
ConditionPathExists=/etc/vsftpd/example
ConditionPathExists=!/etc/vsftpd/example.gdbm

[Service]
Type=oneshot
ExecStart=/usr/bin/db_converter --src example --dest example.gdbm
RemainAfterExit=true

[Install]
WantedBy=default.target

0 comments on commit d91fc7e

Please sign in to comment.