LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I need to change minecraft directory as root (https://www.linuxquestions.org/questions/linux-newbie-8/i-need-to-change-minecraft-directory-as-root-4175436315/)

EODSteven 11-08-2012 05:41 PM

I need to change minecraft directory as root
 
Code:

tyler@tyler-Inspiron-531s:~$ cd \.minecraft
tyler@tyler-Inspiron-531s:~/.minecraft$ ls
bin                    lib                ModLoader.txt  stats
config                Minecraft.desktop  mods          texturepacks
Craftbukkit            MineCraft.desktop  options.txt    texturepacks-mp-cache
crash-reports          minecraft.jar      resources      TooManyItems.txt
default_reference.xml  Minecraft.sh      saves
Icons                  Minecraft.sh~      screenshots
lastlogin              Minecraftsvg      servers.dat
tyler@tyler-Inspiron-531s:~/.minecraft$

I need to change the .minecraft directory to root but I can't figure out directory structure...Please help! Also need to add this to script to run it every time.
Code:

#!/bin/sh
 BINDIR=$(dirname "$(readlink -fn "$0")")
 cd "$BINDIR"
 chown -R tyler:tyler /home/minecraft
 java -Xmx1024M -Xms512M -jar minecraft.jar
 chmod -R 755 /home/minecraft


EODSteven 11-08-2012 05:51 PM

here is a thread I been trying to use...just doesn't work....

Code:

Re: Cannot start minecraft with FML
« Reply #4 on: September 26, 2012, 02:14:32 PM »
had similar problem with my debian dedicated server. FML tries to load some files.
i managed this by start minecraft this as root. after that u have give rights back to the user...
u know this stuff like:
Code: [Select]

chown -R userxyz:userxyz /home/minecraft
chmod -R 755 /home/minecraft


unSpawn 11-08-2012 08:23 PM

Quote:

Originally Posted by EODSteven (Post 4825370)
here is a thread I been trying to use...just doesn't work....

That thread wasn't clear at all plus it mentions copying files as alternative. So before you follow that advice I think you should know if that will solve your problems. What are the actual errors you've been getting?

shivaa 11-08-2012 08:28 PM

So what exactly the problem is? if you want to change owner and group of the dir. to root:root, then you can do it in same way as you did with tylor:tylor, as-
Code:

chown root:root <dir>
Quote:

chown -R tyler:tyler /home/minecraft
Pl make sure is it "minecraft" or ".minecraft"!
Also post output of ls -la, instead of just ls.
Quote:

tyler@tyler-Inspiron-531s:~/.minecraft$
I am not sure, but ain't you asking to change it in your shell prompt (asking just because of my doubt)?

EODSteven 11-09-2012 05:52 AM

When I wrote this last night i don't think I knew what I really needed but i've had some time to think about it so I hope i can get a better scenario. I'm not a gamer, My grandson askes me from time to time to help him set up stuff on his Minecraft game...so I'm asking for help! :)

Apparently for this game to load properly, I'm assuming because it updates everytime it loads, it needs to be run as the root or home...(make sense?...I hope so cause it doesn't to me!) I have a script file that loads the proper java settings and starts his Minecraft game so I just need to add the commands that make the .minecraft folder the root or home folder and that is supposed to solve the loading issue...(the game freezes now when it tries to load a program called FML or Forge Mod Loader, that it needs to update everytime it loads.)

In the threads I've been reading the commands needed to load this game properly ar chown and chmod but I do not know how to comunicate the path I need. I know the Minecraft folder is in tyler-home-.mincraft but there is also all this stuff that makes no sense to me...tyler@tyler-Inspiron-531s:. I don't understand basic directory structure in Linux...I know, you guys are saying how stupid I am, but I'm not..I'm reasonably intelligent. The only drawback I have noticed in Linux is the basic directory structure. It is just plain confusing to me. Other than that, It is wonderful!

Can anyone help please?

EODSteven 11-09-2012 06:14 AM

1 Attachment(s)
Here is the screen shot of ls -la.

EODSteven 11-09-2012 06:24 AM

1 Attachment(s)
Here is where the game is freezing....trying to update FML....

EODSteven 11-09-2012 06:32 AM

Quote:

Originally Posted by unSpawn (Post 4825435)
That thread wasn't clear at all plus it mentions copying files as alternative. So before you follow that advice I think you should know if that will solve your problems. What are the actual errors you've been getting?

Yea I tried just the copy files instead of the update...only thing is it tells you to put the files in your lib folder and no such folder exists. I created it in the .minecraft folder and did that..still nothing. Thanks though...

EODSteven 11-09-2012 06:38 AM

I tried this in my script file, still not working....

Code:

#!/bin/sh
 BINDIR=$(dirname "$(readlink -fn "$0")")
 cd "$BINDIR"
 chown -R tyler:tyler home/tyler/.minecraft
 chmod -R 755 home/tyler/.minecraft
 java -Xmx1024M -Xms512M -jar minecraft.jar


eSelix 11-09-2012 06:42 AM

Quote:

Apparently for this game to load properly, I'm assuming because it updates everytime it loads, it needs to be run as the root or home
What do you mean by "it needs to be run as root or home"? It should be run normally - on user privilages. This game is programmed that way, it needs to be in ".minecraft" in user home directory. And user running this game needs to have write access to this directory. The simplest way is just install it with user account who want to play it.

The some harder (if you as administrator want to block changing executable files of this game and resources) you can use an union mounting. That way basic files to start a game, mods and for example default settings will be maintained by you on read only directory and files changed by game wil be stored somewhere else in user home diectory.

In this script you have written "home/tyler/.minecraft" it should be absolute path "/home/tyler/.minecraft".

unSpawn 11-09-2012 06:54 AM

Quote:

Originally Posted by EODSteven (Post 4825681)
I'm not a gamer, My grandson askes me from time to time to help him set up stuff on his Minecraft game...

I don't know if he's old (and responsible) enough to be interested in (and capable of) more than point-and-click stuff because it would benefit you (less stress) and him (self-reliance, immersion, understanding) if he got to the point where he can take care of this himself.


Quote:

Originally Posted by EODSteven (Post 4825681)
In the threads I've been reading the commands needed to load this game properly ar chown and chmod

If that's all you need then look at shivaa's post.


Quote:

Originally Posted by EODSteven (Post 4825681)
Apparently for this game to load properly, I'm assuming because it updates everytime it loads, it needs to be run as the root or home...(make sense?...I hope so cause it doesn't to me!) I have a script file that loads the proper java settings and starts his Minecraft game so I just need to add the commands that make the .minecraft folder the root or home folder and that is supposed to solve the loading issue...(the game freezes now when it tries to load a program called FML or Forge Mod Loader, that it needs to update everytime it loads.)

Making the ~/.minecraft folder the root or home folder for the process and running Minecraft as root are two completely different things. If it's more than just chmod / chown commands then it would be good to know what actual errors you've been getting and debug screen output, crash information or running the client in debug mode could provide more information.

Alternatively you could (have your grandson) follow the FML installation instructions or the Forge installation instructions and build a new Minecraft installation in another location (say "~/.minecraft_new") and if that doesn't work out you could (have your grandson) ask in the Minecraft forum.


Quote:

Originally Posted by EODSteven (Post 4825681)
you guys are saying how stupid I am, but I'm not

If you say you're not then who would we be to doubt that?..

EODSteven 11-09-2012 07:00 AM

Quote:

Originally Posted by eSelix (Post 4825716)
What do you mean by "it needs to be run as root or home"? It should be run normally - on user privilages. This game is programmed that way, it needs to be in ".minecraft" in user home directory. And user running this game needs to have write access to this directory. The simplest way is just install it with user account who want to play it.

The some harder (if you as administrator want to block changing executable files of this game and resources) you can use an union mounting. That way basic files to start a game, mods and for example default settings will be maintained by you on read only directory and files changed by game wil be stored somewhere else in user home diectory.

In this script you have written "home/tyler/.minecraft" it should be absolute path "/home/tyler/.minecraft".

It appears your not familiar with Game Modding either....Basically, everytime this game loads it reinstalls itself to run the Mods but in linux in order to install there is some privilage that must be invoked such as home or root. This has to be done every time He starts the game not just once. Thanks anyway....

EODSteven 11-09-2012 07:08 AM

There are lots of ways to say it's not gonna work by saying my skills aren't good enough, but I bet someone can figure this out. Obviously the guy who wrote the other thread who can barely speak english was on to something. I don't know how to post a debug screen and I wouldn't think that would be a skill appropriate for a Linux Newbie. Constructive crticism please ...not just bashing.

EODSteven 11-09-2012 07:11 AM

Can anyone figur out what this guy is saying?

Quote:

Originally Posted by EODSteven (Post 4825370)
here is a thread I been trying to use...just doesn't work....

Code:

Re: Cannot start minecraft with FML
« Reply #4 on: September 26, 2012, 02:14:32 PM »
had similar problem with my debian dedicated server. FML tries to load some files.
i managed this by start minecraft this as root. after that u have give rights back to the user...
u know this stuff like:
Code: [Select]

chown -R userxyz:userxyz /home/minecraft
chmod -R 755 /home/minecraft



shivaa 11-09-2012 07:26 AM

Well, I am also not familiar with this game, but after reading all the threads above, it sounds some inappropriate permissions/ownership set on the directories, which are causing the pb.
Also you've made some mistakes in your script with paths & directory names. So once invoke following series of cmds:
Code:

cd /home/tyler
chown -R tyler:tyler .
chmod -R 755 .
chmod -R 755 ~/.minecraft
chown -R tyler:tyler ~/.minecraft
java -Xmx1024M -Xms512M -jar minecraft.jar

If it cannot help, then pl share the error message, if any. Be careful about paths, directory names & their spelling, when you're using them. Also take a note, if there're any link files for .minecraft inside /home/tyler or inside /home/tyler/.minecraft directory, because chown & chmod cmds with -R option will not change permissions/ownership of links. For that you'll need to mention "-h" option with -R.


All times are GMT -5. The time now is 04:21 AM.