You are not logged in.

#1 2013-01-17 20:31:14

float
Member
Registered: 2012-10-05
Posts: 15

[SOLVED] Where to put dosbox games to share them between users?

Hi everybody,

the subject pretty much says it all.
Where should I put my dosbox games to share the files between multiple users?
The file permissions are the problem. I guess, having user writable files outside of /home is not the best idea (isn't it?).

In addition: Highscores and config files need to writable to all users, but config files should not be shared between the users.

Any idea?

Regards,
float

Solved: I'm using UnionFS for most of the games. Highscores are placed in /opt/$pkgname. Thank you for your ansers!

Last edited by float (2013-02-14 20:23:45)

Offline

#2 2013-01-17 20:40:42

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: [SOLVED] Where to put dosbox games to share them between users?

Well, your answer is using symlinks.

Put the games binaries and data on /usr/share/gamedir, and create local symbolic links of each file under $HOME/gamedir/. Create a dir for the game under /opt/gamedir/ and make it writeable to all users. Store there the Highscores file and link that file on $HOME/gamedir/.

Play the game on the $HOME/gamedir/ of each user.

Read the wiki article about creating wine packages, I know is not what you are trying to do, but it gives good advises for similar situations.

EDIT: Be careful with the highscores file. If the game is played simultaneosly, the file could get corrupted - but, there would be no losses, except for the highscores... but that would be kind of a tragic loss, right? wink

Last edited by chris_l (2013-01-17 20:45:37)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2013-01-17 20:47:22

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,596
Website

Re: [SOLVED] Where to put dosbox games to share them between users?

Hmm... should be another solution if the users are the in same group, no?

http://xyne.archlinux.ca/notes/linux/sh … ctory.html


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2013-01-17 20:55:01

float
Member
Registered: 2012-10-05
Posts: 15

Re: [SOLVED] Where to put dosbox games to share them between users?

Thanks for the replys!

I think the symlink idea solves all the problems. A bit complicated, especially if there are many files to symlink, but still the best solution.
I already thought about the group, but that wouldn't solve the config file issue.

Offline

#5 2013-01-17 21:05:09

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: [SOLVED] Where to put dosbox games to share them between users?

Well, in the wiki article I gave you above, the idea is to create an script under /usr/bin/ that automatically creates the directory, symlinks, etc.

I created a wine package for touhou 7, that does something similar (except for the highscores part). You can check it here: https://aur.archlinux.org/packages/th07/

It works by executing an script called th07, and that automates the directory creating, symlinking and other things (like, it patches something in the config options, etc)
Check the script here: http://sprunge.us/eEAb

The user only executes "th07" and it does the rest automatically.

float wrote:

A bit complicated, especially if there are many files to symlink,

You can symlink the entire directories wink

Last edited by chris_l (2013-01-17 21:07:02)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#6 2013-01-18 09:02:51

ezzetabi
Member
Registered: 2006-08-27
Posts: 943

Re: [SOLVED] Where to put dosbox games to share them between users?

If you do not mind installing union fusefs, I think the simplest solution is using it to manage the multi user.
The idea is installing in /usr/share/GAMENAME; creating a directories ~/.GAMENAME/{MOUNT,DIFF}; to mount in ~/.GAMENAME/MOUNT the union of /usr/share/GAMENAME (read only) and ~/.GAMENAME/DIFF (copy on write).

This is that I done in generally. You can see the script created in the PKGBUILD, seek for the lines made of ####.


(Nice to see that the article I started time ago is used smile )

Last edited by ezzetabi (2013-01-18 09:05:00)

Offline

#7 2013-01-18 16:31:29

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: [SOLVED] Where to put dosbox games to share them between users?

@ezzetabi: That is great for storing locally only the changes. Is useful for saving space when several people will have almost the same data stored, except some few changes.
But that is not exactly what the OP wants to achieve. He certainly wants to have the same game data, and have locally the config files. But he also wants to have one common highscores file, that is writeable for everyone. So is like this:

  • Game data  - readable-only for every one

  • Config files - readable/writeable and isolated for each user

  • Highscores - Exactly the same file, readable/writeable for anyone.

While union fusefs could help with the first 2 things, for the last one is necessary to use a symlink to an area writeable for anyone. And since in the end is necessary to use a symlink, maybe is more easy just to use symlinks for all.

So the path to solve it could be one of this options:

  • Install union fusefs, create an script to automount the files and create a symlink for the highscore files if it does not exist, and then run dosbox

  • Create an script to create the symlinks if they don't exist and then run dosbox

Last edited by chris_l (2013-01-18 16:56:09)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#8 2013-01-19 11:12:57

ezzetabi
Member
Registered: 2006-08-27
Posts: 943

Re: [SOLVED] Where to put dosbox games to share them between users?

If you know exactly where highscore are saved (inside a directory or a file) you can also solve with fuse unionfs:

See this example:

$ mkdir all base user mp
$ touch base/basegamefiles
$ touch all/highscore_file
$ mkdir all/highscore_dire
$ unionfs -o cow user=RW:all=RW:base=RO mp
$ cd mp
$ ls
basegamefiles  highscore_dire/  highscore_file
$ echo 'new highscore!' >highscore_file
$ echo 'new highscore!' >highscore_dire/new_file
$ touch 'a setting file'
$ cd ..
$ fusermount -zu mp
$ find .
.
./all
./all/highscore_file
./all/highscore_dire
./all/highscore_dire/new_file
./user
./user/a setting file
./mp
./base
./base/basegamefiles
$

The idea is the base directory will be in /usr/share, the user will be in ~/.something and the all directory will be in a special directory writable by the players. chmod 775 maybe?
All assumes players cannot play at the same time. If it is the case it become more complex.

Last edited by ezzetabi (2013-01-19 11:20:18)

Offline

#9 2013-01-29 20:56:43

ezzetabi
Member
Registered: 2006-08-27
Posts: 943

Re: [SOLVED] Where to put dosbox games to share them between users?

So float? Did you solve?

Offline

Board footer

Powered by FluxBB