Correct permissions prior to using Maven and Ant while installing Dspace 6.3

61 views
Skip to first unread message

Ashim Kapoor

unread,
Apr 28, 2021, 10:51:32 AM4/28/21
to DSpace Technical Support
Dear Dspace Experts,

I wish to know the correct permissions for the directories [dspace]
and [dspace-source] prior to running Maven and Ant.

I am using the definitions of [dspace] and [dspace-source] as on this page:

https://wiki.lyrasis.org/display/DSDOC6x/Installing+DSpace

Here is what I have been doing till now:

For Running Maven (as user dspace):
I first make sure that the dspace user owns the [dspace-source] directory.

sudo chmod 700 -R [dspace-source]
( Basically rwx for [dspace-source])
mvn package

For Running Ant as user dspace:

sudo chmod 500 -R [dspace-source]
( Basically READ and EXECUTE permission for [dspace-source])
sudo chmod 200 -R [dspace]
( Amounts to WRITE permission for [dspace])
sudo chmod u+x -R [dspace]
This is so that the installed files can be executed
sudo chmod g+s -R [dspace]
This is so that the newly created files in [dspace] should inherit the
group ( which is the same as the dspace user). so that permissions are
inherited.
sudo chmod 700 -R [dspace-source]

Then I do, as user dspace:-
cd [dspace-source]/dspace/target/dspace-installer
ant fresh_install

Can someone here comment on my attempt ? Please share the best practice.

Thank you,
Ashim

Fru Emmanuel

unread,
May 4, 2022, 6:02:46 PM5/4/22
to DSpace Technical Support
Hello, 

Does setting these permissions allow you tu run ant ?

Kind regards,

darryl....@usask.ca

unread,
May 4, 2022, 11:41:58 PM5/4/22
to DSpace Technical Support
Ashim, those permissions look pretty restrictive.  Does the build and install actually work for you?

I know the install docs mention the "dspace" user, but it also states "you must ensure the Tomcat owner also owns [dspace], OR you can create a new 'dspace' user account, and ensure that Tomcat also runs as that account".  We went with the former (because that was easier and more standard than changing the account Tomcat runs as), and made sure the "tomcat" user and group owned all the files.

This is mostly from memory, but for the [dspace] directory I did something like:

     sudo mkdir [dspace]
     sudo chown tomcat:tomcat [dspace]
     sudo chmod 2775 [dspace]

And for the [dspace-source] directory I did something like:

     # Set the permissions
     sudo chown -R tomcat:tomcat [dspace-source]
     sudo chmod -R ug+rw [dspace-source]
     # Build DSpace
     sudo su - tomcat
     cd [dspace-source]
     $ Install
     mvn package
     cd dspace/target/dspace-installer
     ant fresh_install

I won't say that that's the only way, or even the correct way, but that worked for us.

- Darryl

Ashim Kapoor

unread,
May 5, 2022, 12:50:01 AM5/5/22
to darryl....@usask.ca, fru9...@gmail.com, DSpace Technical Support
Dear Fru and Darryl,

If my memory serves me correctly, I do think these settings worked for me.

I could be mistaken though.

I will do an experiment and again use the settings which I was curious
about and let you know. You will have to give me some time though for
me to do this experiment.

Best,
Ashim
> --
> All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> ---
> You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/93d3d862-38ff-4951-b66e-2d3e0d14c39dn%40googlegroups.com.

Night Librarian

unread,
Aug 22, 2022, 11:18:43 PM8/22/22
to DSpace Technical Support
Greetings!

I have a tiny question. I want to run the installation as a tomcat user, instead of dspace, as described in this conversation. Howerver, when I try to run on Ubuntu 20.4:

sudo su - tomcat

I get:

"This account is currently not available."


Do I need to be a superuser to run mvn and ant?  And if not, can I switch to just "tomcat" user like this?

su tomcat

Because when I try, I am prompted for password, which I don't have, probably because I didn't create a "tomcat" account manually, so I end up with:

su: Authentication failure

How can I run install as a tomcat user?

Mark H. Wood

unread,
Aug 23, 2022, 8:30:04 AM8/23/22
to dspac...@googlegroups.com
On Mon, Aug 22, 2022 at 08:18:43PM -0700, Night Librarian wrote:
> I have a tiny question. I want to run the installation as a tomcat user,
> instead of dspace, as described in this conversation. Howerver, when I try
> to run on Ubuntu 20.4:
>
> sudo su - tomcat
>
> I get:
>
> "This account is currently not available."
>
>
> Do I need to be a superuser to run mvn and ant? And if not, can I switch
> to just "tomcat" user like this?
>
> su tomcat
>
> Because when I try, I am prompted for password, which I don't have,
> probably because I didn't create a "tomcat" account manually, so I end up
> with:
>
> su: Authentication failure
>
> How can I run install as a tomcat user?

"This account is currently not available." -- you'll probably find
that the user 'tomcat' has '/sbin/nologin' for its shell. That's
where this message comes from. You can override that by specifying
the shell to use:

sudo su - tomcat -s /bin/sh

You'll probably find that the encrypted password for 'tomcat' is "!"
which means "don't accept *any* password". So you need 'sudo' or
being superuser to 'su' to 'tomcat'. The account effectively has a
password that can never be known or guessed, because nothing will ever
encrypt to "!".

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Night Librarian

unread,
Aug 24, 2022, 3:12:30 PM8/24/22
to DSpace Technical Support
Thank you, Mark!

Worked like a charm!
Reply all
Reply to author
Forward
0 new messages