macports user ...

Peter Danecek Peter.Danecek at bo.ingv.it
Fri Sep 27 08:09:30 PDT 2013


On Sep 27, 2013, at 16:54 , Joshua Root <jmr at macports.org> wrote:

> On 2013-9-28 00:45 , Peter Danecek wrote:
>> 
>> Hi all,
>> 
>> I have some doubt about the the user macports and how it is used exactly. From what I understood most operations when installing MacPorts are performed as macports user, files belong to macports user etc.
>> 
>> Now I am trying to setup some new port and would need to do some manual testing, i.e. do some operation as macports user. I tried to su to macports user, but this would not work. Any trick how this should be done?
> 
> sudo -u macports ...
> 
> Actually I think su would work too, but you'd have to run it as root
> since there's no password.

Well, that is what I tried (both), however it would not work for me. So I assumed this the story was somewhat more complicated and was wondering, what's the trick behind.

--- snip ---
[radegast:irods/work/iRODS] petr% sudo scripts/irodsprompt
Password:
Usage error:
    This script should *not* be run as root.
[radegast:irods/work/iRODS] petr% sudo -u macports scripts/irodsprompt
sudo: unable to change to runas uid (503, 503): Operation not permitted
sudo: unable to execute scripts/irodsprompt: Operation not permitted
[radegast:irods/work/iRODS] petr% 
--- snap ---
[radegast:irods/work/iRODS] petr% sudo -s 
.local/etc/env/SAC.csh: No such file or directory.
[radegast:irods/work/iRODS] root# su macports
[radegast:irods/work/iRODS] root# whoami
root
[radegast:irods/work/iRODS] root# 
--- snap ---

> What kind of manual testing do you need to do, anyway?

The program I am working with has a non standard configuration step. I am trying to figure out how to do this right and for convenience I work directly with the macports work directory. In general, I would just use `sudo`, not caring about the fact to operate as root. Unfortunately the script is preventing to be run as root (see above), so I was trying to do so as macports and failed to change user ...

Any ideas?
~petr


> 
> - Josh




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1762 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20130927/91a33402/attachment.p7s>


More information about the macports-dev mailing list